Exemplo n.º 1
0
    private IEnumerator LateStart()
    {
        yield return(new WaitForSeconds(0.001f));

        MainGame.SetActive(false);
        GameHUD.SetActive(false);
        HeroTutorial.SetActive(false);
        HeroHUD.SetActive(false);
        for (int i = 0; i < HeroInstructions.Length - 1; ++i)
        {
            HeroInstructions[i].SetActive(false);
        }
        MechanicsList.SetActive(false);
        for (int i = 0; i < Mechanics.Length - 1; ++i)
        {
            Mechanics[i].SetActive(false);
        }
    }
Exemplo n.º 2
0
    private void Update()
    {
        Player = GameManager.Instance.Player;
        switch (currentState)
        {
        case STATES.STATE_HERO:
            if (!HeroInstanciate)
            {
                HeroTutorial.SetActive(true);
                HeroHUD.SetActive(true);
                HeroCamScript.inst.SwitchView();
                HeroInstanciate = true;
                HeroInstructions[0].SetActive(true);
            }
            if (Welcome)
            {
                HeroInstructions[0].SetActive(false);
                HeroInstructions[1].SetActive(true);
                MechanicsList.SetActive(true);
                Welcome = false;
            }
            else if (Camera)
            {
                HeroInstructions[1].SetActive(false);
                HeroInstructions[2].SetActive(true);
                Mechanics[1].SetActive(true);
                Camera = false;
            }
            else if (Movement)
            {
                HeroInstructions[2].SetActive(false);
                Movement = false;
            }
            if (RedSpawn.GetComponent <TutSpawnRed>().Battle)
            {
                if (GameObject.FindGameObjectsWithTag("Minion").Length <= 1)
                {
                    RedSpawn.GetComponent <TutSpawnRed>().Battle = false;
                    End.SetActive(true);
                    Ending.SetActive(true);
                }
            }
            break;

        case STATES.STATE_MINION:
            if (SpawnMinionTutRed)
            {
                RedSpawns = MinionRedSpawns;
                SpawnRedStrikerMinion();
                SpawnRedStrikerMinion();
                SpawnRedTankMinion();
                SpawnRedTankMinion();
                SpawnRedTankMinion();
                SpawnRedStrikerMinion();
                SpawnRedStrikerMinion();
                SpawnRedStrikerMinion();
                SpawnMinionTutRed = false;
            }
            if (SpawnMinionTutBlue)
            {
                SpawnBlueStrikerMinion();
                SpawnBlueStrikerMinion();
                SpawnBlueStrikerMinion();
                SpawnBlueTankMinion();
                SpawnBlueTankMinion();
                SpawnBlueCasterMinion();
                SpawnMinionTutBlue = false;
            }
            if (Input.GetKeyDown(KeyCode.C) && !firstswitch)
            {
                MoveMainCam.SetActive(true);
                firstswitch = true;
            }
            if (RedTower && !RedTower.activeInHierarchy)
            {
                TogglePause();
                MinionEnd.SetActive(true);
            }
            break;

        default:
            break;
        }
        if (!PlayedIntro)
        {
            if (Input.GetKeyDown(KeyCode.Return))
            {
                PlayedIntro = true;
                IntroSequence.SetActive(false);
                currentState = STATES.STATE_HERO;
            }
        }
        if (Input.GetKeyDown(KeyCode.Backspace))
        {
            SpawnRedTankMinion();
            SpawnRedCasterMinion();
            SpawnRedStrikerMinion();
        }
        if (Player && !Player.activeInHierarchy)
        {
            Death.SetActive(true);
        }
    }