Esempio n. 1
0
    // Check if the game ends and handle recording accordingly
    public static bool CheckIfGameEnds()
    {
        GameStateRecorder gsr = GameObjectFinder.FindGameStateRecorder();

        GameObject[] players  = GameObjectFinder.FindAllCharacters();
        int          numAlive = 0;

        foreach (GameObject player in players)
        {
            if (!player.GetComponent <Character>().IsDead)
            {
                numAlive++;
            }
        }
        if (numAlive == 1)
        {
            gsr.FinishRecording();
            return(true);
        }
        else
        {
            return(false);
        }
    }