Example #1
0
        private bool checkIfAllPlayersDead()
        {
            bool allDead    = false;
            int  aliveCount = 0;

            foreach (GameObject player in players)
            {
                Controllers.PlayerController playerContr = player.GetComponent <Controllers.PlayerController>();
                bool isAlive = playerContr.isAlive;
                if (isAlive)
                {
                    aliveCount++;
                }
            }
            if (aliveCount < 1)
            {
                allDead = true;
            }
            return(allDead);
        }