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

        component.state = newState;
        ReplaceComponent(index, component);
    }
コード例 #3
0
ファイル: MapView.cs プロジェクト: HappyPiggy/ECS_Charles
    public void OnGameProgress(GameEntity entity, GameProgressState state)
    {
        //   Debug.Log("GameRestart "+ state);

        if (state == GameProgressState.GameRestart)
        {
            CleanGameScene();
        }
    }
コード例 #4
0
    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);
    }
コード例 #5
0
    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());
 }