Beispiel #1
0
        public void GetAllMiniRecipesTest()
        {
            CalorieCounter calorieCounter = new CalorieCounter();

            // TODO: CalorieCounter needs new test.
            //List<MiniRecipe> miniRecipes = calorieCounter.GetAllMiniRecipes();

            //Assert.AreEqual(3, miniRecipes.Count);
        }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        // Disable all gyms
        for (int i = 0; i < gyms.Length; i++)
        {
            gyms[i].SetActive(false);
        }

        // Re - enable the one we want(or random if rand selected)
        int gymToEnable = PlayerPrefs.GetInt("GymInd");

        // If random is selected or error just pick randomly
        if (gymToEnable >= gyms.Length || gymToEnable < 0)
        {
            gymToEnable = Random.Range(0, gyms.Length);
        }
        gyms[gymToEnable].SetActive(true);         // Enable that gym

        // rename it so paths still work
        gyms[gymToEnable].name = "GYM";

        // Get everything
        CUSTOM_ROUTINE_PATH = Application.persistentDataPath + "/CustomRoutineData.txt";
        hCal        = GameObject.Find("HeightCalibrator").GetComponent <HeightCalibrator>();
        waveShooter = GameObject.Find("WaveShooter").GetComponent <WaveShooter>();
        destroyWall = GameObject.Find("WallDestroyer").GetComponent <DestroyWall>();
        GameObject ccgo = GameObject.Find("CalorieCounterOrig");

        if (ccgo != null)
        {
            calorieCounter = ccgo.GetComponent <CalorieCounter>();
        }

        loadingReset = false;

        for (int i = 0; i < waveTransiton.Length; i++)
        {
            waveTransiton[i] = true;
        }

        timer        = 0;
        livesLeft    = 0;
        onBreakTimer = float.PositiveInfinity;

        // If the file doesnt exist then load the normal defaults, else read from file
        if (File.Exists(CUSTOM_ROUTINE_PATH) == false)
        {
            // Enable all walls by default
            for (int i = 0; i < 3; i++)
            {
                wallTypesAllowed[i]       = true;
                cardioWallTypesAllowed[i] = true;
            }

            if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeClassic)                    // Clasic Mode
            {
                warmUp             = true;
                pauseAfterXWaves   = int.MaxValue;
                secondsToPauseFor  = 0;
                switchModesOnBreak = false;
            }
            else                                                                                                                                                        // Arcade Mode
            {
                warmUp = false;
                //livesLeft = 3;
                pauseAfterXWaves  = 50;
                secondsToPauseFor = 15;
                cardioMode        = false;
                // If we are on cardio mode we are acatually on cardio/squat mode
                if (PlayerPrefs.GetInt(Constants.cardioMode) == 1)
                {
                    switchModesOnBreak = true;
                }
                else
                {
                    switchModesOnBreak = false;
                }
            }
        }
        else
        {
            this.SetCustomRoutineData();

            // If we are in custom mode, check to update the stat
            if (PlayerPrefs.GetInt(Constants.gameMode) == Constants.gameModeCustom)
            {
                customRoutineStatCheck = true;
                // Set the arcade pause menus
                for (int i = 0; i < pauseMenues.Length; i++)
                {
                    pauseMenues[i].SetPauseButton(Instantiate <GameObject>(Resources.Load <GameObject>("Other/PauseMenuCustom")));
                }
            }
        }

        this.ActivateGameMode();
    }