예제 #1
0
    // Update is called once per frame
    void Update()
    {
        // Check for Win
        if (player[0].taskProgress == 100 && !gameOver)
        {
            gameOver = true;
            winManager.ActivateWinScene("Spell");
            hero = (player[0].humanPlayer) ? player[0].playerName : "Player 1";
        }
        else if (player[2].taskProgress == 100 && !gameOver)
        {
            gameOver = true;
            winManager.ActivateWinScene("Cop");
            hero = (player[2].humanPlayer) ? player[2].playerName : "Player 3";
        }
        else if (player[3].taskProgress == 100 && !gameOver)
        {
            gameOver = true;
            winManager.ActivateWinScene("Car");
            hero = (player[3].humanPlayer) ? player[3].playerName : "Player 4";
        }

        // Check if enough players are dead for a Game Over Status
        if (totalDeadPlayers > 3 && !gameOver)
        {
            gameOver = true;
            StartCoroutine(GameOver());
        }


        /**********FOR TESTING ONLY*****************/
        //CULTIST ATTACKS
        if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            attackCultist[0].DoAction();
        }
        if (Input.GetKeyDown(KeyCode.Alpha6))
        {
            attackCultist[1].DoAction();
        }
        if (Input.GetKeyDown(KeyCode.Alpha7))
        {
            attackCultist[2].DoAction();
        }
        if (Input.GetKeyDown(KeyCode.Alpha8))
        {
            attackCultist[3].DoAction();
        }

        // CROW ATTACKS
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            floatingCrowCultist[0].DoAction();
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            floatingCrowCultist[1].DoAction();
        }
        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            floatingCrowCultist[2].DoAction();
        }
        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            floatingCrowCultist[3].DoAction();
        }

        /*******END OF TESTING CODE********************/
    }