示例#1
0
    IEnumerator DelayAttack()
    {
        if (PlayerPrefs.GetInt("LittleGuardInHome") == 1)
        {
            actionType = GuardionActionType.attac;
            Right();
            anim.SetTrigger("Attack");
            yield return(new WaitForSeconds(2f));

            DestroyWall?.Invoke();
            PlayerPrefs.SetInt("LittleGuardInHome", 3);
        }
    }
示例#2
0
 private void Awake()
 {
     singleton = this;
     particle1 = GameObject.Find("LZ_BangD001").transform.Find("mei001").gameObject;
     particle2 = GameObject.Find("LZ_BangD002").transform.Find("mei001").gameObject;
 }
示例#3
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();
    }
示例#4
0
 void Start()
 {
     dw = dw.GetComponent <DestroyWall>();
 }