Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnGUI()
- {
- if (!gameReady && editormode)
- {
- if (!saveclicked)
- {
- if(GUI.Button(new Rect(10,10,70,30), "Save!"))
- {
- saveclicked = true;
- stringtoexport = "";
- for (gg=1;gg<3;gg++)
- {
- if (gg == 1)
- {
- gosx = GameObject.FindGameObjectsWithTag("bgtag");
- objecttype = "001,";
- }
- else if (gg == 2)
- {
- gosx = GameObject.FindGameObjectsWithTag("cantoccupytag");
- objecttype = "002,";
- }
- foreach(GameObject go in gosx)
- {
- stringtoexport = stringtoexport + objecttype + go.transform.position.x + "," + go.transform.position.y + ";";
- }
- }
- }
- }
- if (saveclicked)
- {
- levelname = GUI.TextField(new Rect(10,10,70,30), levelname, 50);
- if(GUI.Button(new Rect(90,10,70,30), "OK"))
- {
- //Do something (save to external file).
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement