public void Update() { AState currentState = GetCurrentState(); if (currentState != null) { currentState.Update(); } }
protected override void Update(GameTime gameTime) { if (IsActive) { _currentState.Update(gameTime); _currentState.PostUpdate(gameTime); base.Update(gameTime); } }
public void Update() { AState currentState = Top(StateStack); if (currentState != null) { currentState.Update(); if (currentState.IsComplete) { currentState.Exit(); StateStack = StateStack.Where(x => !x.IsComplete).ToList(); /* We don't enter in the same loop as an exit, or the states may conflict. */ currentState = Top(StateStack); WaitingToFinish = currentState == null; } } }
// Update is called once per frame void Update() { state.Update(); }