예제 #1
0
    }    //end of Start

    void OnClick()
    {
        if (costumeOwned == false)                                 //buy button tapped
        {
            if (hInGameScriptCS.getCurrencyCount() >= costumeCost) //check if user has enough currency
            {
                //deduct the cost of costume
                hInGameScriptCS.alterCurrencyCount(-costumeCost);

                //change the texture of the character
                characterMaterial.SetTexture("_MainTex", characterCostume);

                //turn off buy and show equip button
                uilBuyEquipButton.text = "EQUIP";

                //change the costumeOwned
                costumeOwned = true;

                //take the user to the main menu
                hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.MainMenu);
                hNGUIMenuScript.CloseMenu(NGUIMenuScript.NGUIMenus.ShopCostumes);
            }                          //end of if cost == cash
        }
        else if (costumeOwned == true) //equip button tapped
        {
            //change the texture of the character
            characterMaterial.SetTexture("_MainTex", characterCostume);

            //take the user to the main menu
            hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.MainMenu);
            hNGUIMenuScript.CloseMenu(NGUIMenuScript.NGUIMenus.ShopCostumes);
        }
    }    //end of On Click function
예제 #2
0
 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
예제 #3
0
 void OnClick()
 {
     hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.SettingsMenu);
     NGUITools.SetActive(this.transform.parent.gameObject, false);
 }
예제 #4
0
    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()