Update() public method

public Update ( ) : void
return void
コード例 #1
0
ファイル: GameController.cs プロジェクト: wildrabbit/7drl-lib
    // Update is called once per frame
    void Update()
    {
        if (_loading)
        {
            return;
        }

        _input.Read();
        var currentState = _playStatesData[_playStateID];

        currentState.Refresh(this);
        _nextPlayStateID = _playStates[_playStateID].Update(_playStatesData[_playStateID], out var timeWillPass);


        if (timeWillPass)
        {
            _timeController.Update(ref _playStateID);
        }

        _entityController.RemovePendingEntities();
        _entityController.AddNewEntities();

        if (_playStateID != _nextPlayStateID)
        {
            _playStates[_playStateID].Exit(_playStatesData[_playStateID]);
            _playStateID = _nextPlayStateID;
            _playStates[_playStateID].Enter(_playStatesData[_playStateID]);
        }

        if (_result == GameResult.Running)
        {
            _result = EvaluateVictory();
        }
    }
コード例 #2
0
 private void Update() => timeController.Update();
コード例 #3
0
 void Update()
 {
     TimeController.Update(Time.deltaTime);
     BoostWatcher.Update();
     HandleInput();
 }