public IStateStackState <T> Pop() { IStateStackState <T> state = states[states.Count - 1]; states.Remove(state); state.Exit(); return(state); }
public override void Update(float dt) { for (int i = states.Count - 1; i >= 0; i--) { IStateStackState <T> state = states[i]; state.Update(dt); bool isBlock = state.IsBlock(); if (isBlock) { break; } } if (states.Count == 0) { return; } }
public void Push(IStateStackState <T> state, T context) { states.Add(state); state.Enter(context); }