} //end of handler android back button function /* * FUNCTION: Perform function according to the clicked button. * CALLED BY: listenerClicks() */ private void handlerShopMenu(Transform buttonTransform) { if (buttonTransform == tShopHomeButtons[0]) //back button { hMenuScriptCS.setMenuScriptStatus(true); setShopScriptEnabled(false); CloseMenu((int)ShopMenus.ShopHome); hMenuScriptCS.ShowMenu((int)MenuScriptCS.MenuIDs.MainMenu); } else if (buttonTransform == tShopHomeButtons[1]) //costumes button { CloseMenu((int)ShopMenus.ShopHome); ShowMenu((int)ShopMenus.Costumes); } else if (buttonTransform == tShopHomeButtons[2]) //powerups button { CloseMenu((int)ShopMenus.ShopHome); ShowMenu((int)ShopMenus.Powerups); } else if (buttonTransform == tShopHomeButtons[3]) //utilities button { CloseMenu((int)ShopMenus.ShopHome); ShowMenu((int)ShopMenus.Utilities); } else if (buttonTransform == tShopHomeButtons[4]) //IAP button { CloseMenu((int)ShopMenus.ShopHome); ShowMenu((int)ShopMenus.IAPs); } } //end of handler shop menu function
void Update() { if (iMenuStatus == 0) //normal gameplay { ; } else if (iMenuStatus == 1) //display main menu and pause game { if (isCustomMenuEnabled()) { hMenuScriptCS.setMenuScriptStatus(true); } else { hNGUIMenuScript.NGUIMenuScriptEnabled(true); } bGamePaused = true; iMenuStatus = 2; } //Pause GamePlay if (iPauseStatus == 1) //pause game { if (isCustomMenuEnabled()) { hMenuScriptCS.setMenuScriptStatus(true); hMenuScriptCS.displayPauseMenu(); } else { hNGUIMenuScript.NGUIMenuScriptEnabled(true); hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.PauseMenu); } iPauseStatus = 2; } else if (iPauseStatus == 3) //resume game { if (isCustomMenuEnabled()) { hMenuScriptCS.setMenuScriptStatus(false); } else { hNGUIMenuScript.NGUIMenuScriptEnabled(false); } bGamePaused = false; iPauseStatus = 0; } if (iDeathStatus == 1) //call death menu { hPowerupsMainControllerCS.deactivateAllPowerups(); //deactivate if a powerup is enabled iDeathStatus = 2; } else if (iDeathStatus == 2) { if (isCustomMenuEnabled()) //if custom menu is in use { hMenuScriptCS.setMenuScriptStatus(true); hMenuScriptCS.displayGameOverMenu(); //display the Game Over menu } else //if NGUI menu is in use { hNGUIMenuScript.NGUIMenuScriptEnabled(true); hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.GameOverMenu); } iDeathStatus = 0; } if (bGamePaused == true) { return; } } //end of Update()