Exemplo n.º 1
0
    void BombingTime()
    {
        if (bombingCD < 0)
        {
            if ((damageScript.isEveryMachineFullLife == true) && (playerScript.activateLever == true))// il n'y a plus de dommages && la bombe est lancée
            {
                bombScore++;
                bombs[bombScore - 1].SetActive(true);

                if (bombScore == 3)
                {
                    FindObjectOfType <GameManager>().WinGame();
                }
                else
                {
                    timer     = maxTime;
                    bombingCD = maxBombingTime;
                    StartCoroutine(damageScript.SpawnTentacouille());
                    timer1.color = Color.white;
                    GameObject.Find("Lever").GetComponent <Animator>().SetBool("Enable", false);
                }
            }

            else
            {
                FindObjectOfType <GameManager>().EndGame();
            }
        }

        else
        {
            GameObject.Find("Lever").GetComponent <Animator>().SetBool("Enable", true);
            bombingCD   -= Time.deltaTime;
            timer1.text  = bombingCD.ToString("0");
            timer1.color = timer1Color;
        }
    }