public void ChangeState(SureStatic <T> NewState) { if (NewState != null) { SureStatic.Exit(owner); } SureStatic = NewState; SureStatic.Enter(owner); }
public T owner; //状态机拥有者; public void Init(T owner, SureStatic <T> initalState) { this.owner = owner; SureStatic = initalState; ChangeState(SureStatic); }