Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        // Where the Custom Routine data should be located
        CUSTOM_DATA_PATH = Application.persistentDataPath + "/CustomRoutineData.txt";

        // If we have the main game music destroy it
        GameObject oldMusic = GameObject.Find("KeepMusic");

        if (oldMusic != null)
        {
            Destroy(oldMusic.gameObject);
        }

        // Delete old info about the custom routine
        if (File.Exists(CUSTOM_DATA_PATH) == true)
        {
            File.Delete(CUSTOM_DATA_PATH);
        }

        // The position that the buttons will go to when transitioning
        forwordPos  = new Vector3(-.3f, 1.55f, .861f);
        backPos     = new Vector3(-.3f, 1.55f, 1.2f);
        buttonTimer = float.PositiveInfinity;

        // Active all button sets so we can get their components
        for (int i = 0; i < buttonSet.Length; i++)
        {
            if (buttonSet[i] != null)
            {
                buttonSet[i].SetActive(true);
            }
        }


        // Get control objects
        gymAndSongSelectControl = buttonSet[1].transform.Find("GymSongSelect").GetComponent <GymAndSongSelectControl>();
        gymSongStart            = buttonSet[1].transform.Find("Start").GetChild(0).GetComponent <MainMenuButton>();
        gymSongBack             = buttonSet[1].transform.Find("Back").GetChild(0).GetComponent <MainMenuButton>();

        dailyChallengeControl = buttonSet[2].transform.GetChild(0).GetComponent <DailyChallengeMaster>();
        customRutineControl   = buttonSet[3].transform.GetChild(0).GetComponent <CustomRutineButtonOptionsMaster>();
        gameModeSelector      = buttonSet[4].transform.GetChild(0).GetComponent <WorkOutSelectControl>();

        levelLoader = GameObject.Find("MainMenuLevelLoader").GetComponent <MainMenuLevelLoader>();
        levelToLoad = -1;

        GameObject.Find("MainMenuMusic").GetComponent <MusicVolumeControl>().AudioSetUp();

        // Set up to display the main menu (and deactivate all the others)
        this.ActivateButtonSet("MainMenu");

        // Make sure weight is set properly
        if (PlayerPrefs.GetInt("PlayerWeight") == 0)
        {
            PlayerPrefs.SetInt("PlayerWeight", 160);
        }

        AchivmentAndStatControl.CheckAllAchivments();
    }
Ejemplo n.º 2
0
        public void LoadMainMenu()
        {
            Level             = LevelState.MainMenu;
            Scene             = new Scene(this);
            Scene.Menu        = new MainMenu(Scene);
            Scene.MenuActive  = true;
            Scene.SceneIsMenu = true;
            var menuMenuLevel = new MainMenuLevelLoader(this, Scene, "MainMenu");
            var texture       = Game.Content.Load <Texture2D>("Tekken5Stage");

            Scene.Background = new Background(Scene, texture, 0);
            var renderManager = (RenderManager)Scene.SceneManager.MainGame.GetManager("Render");

            renderManager.LoadContent();
        }