// 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(); } }
private void Update() => timeController.Update();
void Update() { TimeController.Update(Time.deltaTime); BoostWatcher.Update(); HandleInput(); }