Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. void OnGUI()
  2. {
  3.  
  4.  
  5. if (!gameReady && editormode)
  6. {
  7.  
  8.  
  9.  
  10. if (!saveclicked)
  11. {
  12. if(GUI.Button(new Rect(10,10,70,30), "Save!"))
  13. {
  14.  
  15. saveclicked = true;
  16. stringtoexport = "";
  17.  
  18. for (gg=1;gg<3;gg++)
  19. {
  20.  
  21. if (gg == 1)
  22. {
  23. gosx = GameObject.FindGameObjectsWithTag("bgtag");
  24. objecttype = "001,";
  25. }
  26.  
  27. else if (gg == 2)
  28. {
  29. gosx = GameObject.FindGameObjectsWithTag("cantoccupytag");
  30. objecttype = "002,";
  31. }
  32.  
  33.  
  34.  
  35. foreach(GameObject go in gosx)
  36. {
  37. stringtoexport = stringtoexport + objecttype + go.transform.position.x + "," + go.transform.position.y + ";";
  38. }
  39.  
  40. }
  41. }
  42. }
  43.  
  44.  
  45. if (saveclicked)
  46. {
  47. levelname = GUI.TextField(new Rect(10,10,70,30), levelname, 50);
  48.  
  49. if(GUI.Button(new Rect(90,10,70,30), "OK"))
  50. {
  51. //Do something (save to external file).
  52. }
  53.  
  54.  
  55. }
  56. }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement