Exemplo n.º 1
0
    /// <summary>
    /// What button set should be shown
    /// </summary>
    private void ActivateButtonSet(string setToActivate)
    {
        // Disable all button sets
        for (int i = 0; i < buttonSet.Length; i++)
        {
            if (buttonSet[i] != null)
            {
                buttonSet[i].SetActive(false);
            }
        }

        // If we are loading the workout type then set up the continue to be whatever we want to do next
        if (setToActivate.Contains("GameMode"))
        {
            string nextToLoad = setToActivate.Split(' ')[1];
            gameModeSelector.SetContinueButtonToken(nextToLoad);
            gameModeSelector.SetSquatCardio(nextToLoad);
            buttonSet[4].SetActive(true);
        }

        // Go to the classic mode menu and set the buttons to take you to the game, or back to the main menu
        else if (setToActivate == "ClassicMode")
        {
            buttonSet[1].SetActive(true);
            gymSongStart.SetButtonToken("LoadLevel cm");
            gymSongBack.SetButtonToken("GameMode ClassicMode");
        }

        else if (setToActivate == "ArcadeMode")
        {
            buttonSet[1].SetActive(true);
            gymSongStart.SetButtonToken("LoadLevel am");
            gymSongBack.SetButtonToken("GameMode ArcadeMode");
        }

        else if (setToActivate == "LevelSelect")
        {
            buttonSet[1].SetActive(true);
        }

        // Just loads daily challenge stuff
        else if (setToActivate == "DailyChallenge")
        {
            dailyChallengeControl.FillDescription();
            buttonSet[2].SetActive(true);
        }

        // Go to the custom routine menu and set the buttons to take you to the gym select menu, or back to the custom routine
        else if (setToActivate == "CustomRoutine")
        {
            buttonSet[3].SetActive(true);
            gymSongStart.SetButtonToken("LoadLevel cr");
            gymSongBack.SetButtonToken("CustomRoutine");
        }

        // Load the buttons for the wall and activate whatever this load type is
        else if (setToActivate.Contains("LoadLevel"))
        {
            buttonSet[6].SetActive(true);
            // Load the right level and info with the info token given after the load "LoadLevel" keyword
            this.LoadLevel(setToActivate.Split(' ')[1]);
        }
        else         // Going to the main menu if "MainMenu" was passed or an error
        {
            // If we are going back to the menu, we should delete the custom routine data
            if (File.Exists(CUSTOM_DATA_PATH) == true)
            {
                File.Delete(CUSTOM_DATA_PATH);
            }

            // Destroy the collectibles
            GameObject[] cObjs = GameObject.FindGameObjectsWithTag("Collectible");
            for (int i = 0; i < cObjs.Length; i++)
            {
                cObjs[i].GetComponent <ShrinkAndDestroy>().ShrinkDestroy();
            }

            // Reset the load level object
            levelLoader.SetLoadIndex(-1);
            levelLoader.CloseDoors();

            // Load in the correct buttons
            buttonSet[0].SetActive(true);
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// Set the token for the continue button to load whatever menu
 /// </summary>
 public void SetContinueButtonToken(string t)
 {
     continueButton.SetButtonToken(t);
 }