void FixedUpdate() { //display countdown timer on Resume if (iResumeGameState == 0) { ; } else if (iResumeGameState == 1) //display the counter { tmPauseCountdown = GameObject.Find("HUDMainGroup/HUDPauseCounter").GetComponent(typeof(TextMesh)) as TextMesh; ((MeshRenderer)GameObject.Find("HUDMainGroup/HUDPauseCounter").GetComponent(typeof(MeshRenderer))).enabled = true; iResumeGameStartTime = (int)Time.time; iResumeGameState = 2; } else if (iResumeGameState == 2) //count down { tmPauseCountdown.text = Mathf.Round(4 - (Time.time - iResumeGameStartTime)).ToString(); if ((Time.time - iResumeGameStartTime) >= 3) //resume the game when time expires { tmPauseCountdown.text = string.Empty; hInGameScriptCS.processClicksPauseMenu(PauseMenuEvents.Resume); iResumeGameStartTime = 0; iResumeGameState = 0; } } } //end of fixed update
void FixedUpdate() { //display countdown timer on Resume if (iResumeGameState == 0) { ; } else if (iResumeGameState == 1) //display the counter { NGUITools.SetActive(uilPauseCounter.gameObject, true); iResumeGameStartTime = (int)Time.time; iResumeGameState = 2; } else if (iResumeGameState == 2) //count down { uilPauseCounter.text = Mathf.Round(4 - (Time.time - iResumeGameStartTime)).ToString(); if ((Time.time - iResumeGameStartTime) >= 3) //resume the game when time expires { uilPauseCounter.text = string.Empty; NGUITools.SetActive(uilPauseCounter.gameObject, false); hInGameScriptCS.processClicksPauseMenu(MenuScriptCS.PauseMenuEvents.Resume); iResumeGameStartTime = 0; iResumeGameState = 0; } } } //end of fixed update
void OnClick() { if (hNGUIMenuScript.getCurrentMenu() == NGUIMenuScript.NGUIMenus.GameOverMenu) //if this is GameOver menu { hInGameScriptCS.procesClicksDeathMenu(MenuScriptCS.GameOverMenuEvents.Back); } else if (hNGUIMenuScript.getCurrentMenu() == NGUIMenuScript.NGUIMenus.PauseMenu) //if this is Pause menu { hInGameScriptCS.processClicksPauseMenu(MenuScriptCS.PauseMenuEvents.MainMenu); } else if (hNGUIMenuScript.getCurrentMenu() == NGUIMenuScript.NGUIMenus.ShopCostumes || //if Shop Costumes menu is active hNGUIMenuScript.getCurrentMenu() == NGUIMenuScript.NGUIMenus.ShopIAPs || //if Shop IAPs menu is active hNGUIMenuScript.getCurrentMenu() == NGUIMenuScript.NGUIMenus.ShopPowerups || //if Shop Powerups menu is active hNGUIMenuScript.getCurrentMenu() == NGUIMenuScript.NGUIMenus.ShopUtilities) //if Shop Utilities menu is active { hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.ShopHome); //show the Shop Home menu NGUITools.SetActive(this.transform.parent.gameObject, false); //hide the current menu } else { hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.MainMenu); //show the main menu NGUITools.SetActive(this.transform.parent.gameObject, false); //hide the current menu } //end of else } //end of OnClick function