//load in all but the last level
        private IEnumerator NextLevel(float delay)
        {
            yield return(new WaitForSeconds(delay));

            DroneFactory.StopAllCoroutines();
            foreach (Transform child in DroneFactory.transform)
            {
                Destroy(child.gameObject);
            }

            yield return(new WaitForSeconds(delay));

            foreach (var playerManager in _controlSLA.PlayerManagers.Values)
            {
                _score.Scores[playerManager].ResetCurrent();
                NetworkManagerSLAServer.UpdateScore(_score.Scores.Values.ToList());
            }

            if (_controlSLA.GameMode != GameMode.Practice)
            {
                _controlSLA.CurrentLevel++;
            }

            _controlSLA.InitializeLevel();
        }
示例#2
0
        private IEnumerator AddScore()
        {
            yield return(new WaitForSeconds(0.25f));

            while (_controlSLA.PlayerManagers.Values.Any(pM => !pM.IsDead))
            {
                foreach (var playerManager in _controlSLA.PlayerManagers.Values)
                {
                    if (!playerManager.IsDead)
                    {
                        Scores[playerManager].IncrementScore(2);
                        _playersToUpdate.Add(Scores[playerManager]);
                    }
                }

                NetworkManagerSLAServer.UpdateScore(_playersToUpdate);
                _playersToUpdate.Clear();

                yield return(new WaitForSeconds(0.25f));
            }
        }