public void ChangeState(HomeStateCode eState) { Type type = Type.GetType("HomeState." + eState.ToString()); if (type == null) { return; } HomeStateBase homeStateBase = Activator.CreateInstance(type) as HomeStateBase; if (homeStateBase == null) { return; } this._nextState = homeStateBase; }
public void OnUpdate() { if (!this.enable) { return; } if (this._nextState != null) { if (this._curState != null) { this._curState.OnExit(); } this._curState = this._nextState; if (this._curState != null) { this._curState.OnEnter(); this._nextState = null; } } if (this._curState != null) { this._curState.OnUpdate(0L); } }
public void OnAwake() { HomeManager.m_instance = this; this._curState = null; this._nextState = null; }