예제 #1
0
 public static void Reset()
 {
     _gameProgressManager.gameProgress = 0;
     _progressState = GameProgressState.NotComplete;
     _gameProgressManager.UpdateUi();
     _notifiedProgressMax = false;
 }
    public void ReplaceGameProgress(GameProgressState newState)
    {
        var index     = GameComponentsLookup.GameProgress;
        var component = CreateComponent <GameProgressComponent>(index);

        component.state = newState;
        ReplaceComponent(index, component);
    }
예제 #3
0
    public void OnGameProgress(GameEntity entity, GameProgressState state)
    {
        //   Debug.Log("GameRestart "+ state);

        if (state == GameProgressState.GameRestart)
        {
            CleanGameScene();
        }
    }
    public GameEntity SetGameProgress(GameProgressState newState)
    {
        if (hasGameProgress)
        {
            throw new Entitas.EntitasException("Could not set GameProgress!\n" + this + " already has an entity with GameProgressComponent!",
                                               "You should check if the context already has a gameProgressEntity before setting it or use context.ReplaceGameProgress().");
        }
        var entity = CreateEntity();

        entity.AddGameProgress(newState);
        return(entity);
    }
    public void ReplaceGameProgress(GameProgressState newState)
    {
        var entity = gameProgressEntity;

        if (entity == null)
        {
            entity = SetGameProgress(newState);
        }
        else
        {
            entity.ReplaceGameProgress(newState);
        }
    }
예제 #6
0
    public static void UpdateProgress()
    {
        _gameProgressManager.animator.Play("ProgressBarAnimation", -1, 0f);

        _gameProgressManager.gameProgress += 6f / (PersonSpawner.GetPersonCount() * 5f);

        if (_gameProgressManager.gameProgress > _gameProgressManager.progressSlider.maxValue)
        {
            if (!_notifiedProgressMax)
            {
                NotificationManager.Notify(NotificationType.LevelUp);
                _notifiedProgressMax = true;
            }
            _progressState = GameProgressState.Complete;
        }
        else
        {
            _progressState = GameProgressState.NotComplete;
        }

        _gameProgressManager.UpdateUi();
    }
예제 #7
0
 private static void PrintGameProgress(GameProgressState gameProgressState)
 {
     Console.WriteLine();
     Console.WriteLine("Score: " + gameProgressState.Score.ToString() + "\tLives: " + gameProgressState.Lives.ToString());
 }