Quantcast
Viewing latest article 15
Browse Latest Browse All 54

on start a new game texture is not appearing

my game have 2 level named as "game" and "menu".In my game level i am opening an window that ask for save or not.i just simple click no menu level get open.then again when i click on new game button in menu game level load but texture does not appear on my cube.i am not using any code for save functionality yet.then also it is not working. on start a game texture appear .but click on back i move to menu level ,on again start a game texture doesnot appear. where am i going wrong..?? void Start () { if (MainMenu1.New == true) { dialogScript = gameObject.GetComponent (); for (int a=GridHeight; a>0; a--) { for (int b=0; b (); gems.Add (gemComponent); //gems1.Add (gemComponent); t++; if (a == 1 && b == 3) { gemComponent.cube.renderer.enabled = false; } } } gameObject.transform.position = new Vector3 (-2.5f, -2.5f, 0); positionArray = new Vector3[gems.Count]; for (int i = 0; i < gems.Count; i++) { positionArray [i] = gems [i].transform.position; } ChangePosition(); MainMenu1.New=false; } } } void OnGUI() { GUI.Label( new Rect( 40, 40, 120, 50 ), "Timer: " +timerFormatted , mystyle ); GUI.Label( new Rect( 400, 40, 120, 50 ), "Moves: " +click , mystyle ); if (GUI.Button (new Rect (10, 350, 70, 20), "Back ")) { displayDialog=true; //Application.LoadLevel("level02"); } if (displayDialog) { windowRect = GUI.Window (0, windowRect, WindowFunction, "Save !!!"); } if (GUI.Button (new Rect (200, 350, 70, 20), "Shuffle ")) { ChangePosition(); } if (GUI.Button (new Rect (400, 350, 70, 20), "Settings ")) { Application.LoadLevel("Settings"); } } public void WindowFunction (int windowID) { GUI.Label( new Rect( 40, 40, 120, 50 ), "Do you want to save ?? ",mystyle ); if (GUI.Button (new Rect (10, 70, 70, 20), "Yes ")) { Hello(); Application.LoadLevel("level02"); } if (GUI.Button (new Rect (120, 70, 70, 20), "No ")) { Application.LoadLevel("level02"); } }

Viewing latest article 15
Browse Latest Browse All 54

Trending Articles