/// <summary> /// 空闲状态 /// </summary> public void Idle() { if (this.m_cCurrentState != null) this.m_cCurrentState.OnExit(); this.m_cCurrentState = this.m_cStateWrap.m_cIdleState; this.m_cCurrentState.OnEnter(); }
/// <summary> /// 攻击状态 /// </summary> /// <param name="targetObj"></param> public void Attack() { if (this.m_cCurrentState != null) this.m_cCurrentState.OnExit(); this.m_cCurrentState = this.m_cStateWrap.m_cAttackState; this.m_cCurrentState.OnEnter(); }
/// <summary> /// 移动状态 /// </summary> /// <param name="pos"></param> /// <param name="costTime"></param> public void Move( Vector3 pos , float costTime ) { if (this.m_cCurrentState != null) this.m_cCurrentState.OnExit(); this.m_cStateWrap.m_cMoveState.Set(pos, costTime); this.m_cCurrentState = this.m_cStateWrap.m_cMoveState; this.m_cCurrentState.OnEnter(); }
private StateWrap m_cStateWrap; //状态包对象 #endregion Fields #region Constructors public StateControl(GfxObject obj) { this.m_cStateWrap = new StateWrap(obj); this.m_cCurrentState = null; }
/// <summary> /// 技能状态 /// </summary> public void Skill() { if (this.m_cCurrentState != null) this.m_cCurrentState.OnExit(); this.m_cCurrentState = this.m_cStateWrap.m_cSkillState; this.m_cCurrentState.OnEnter(); }
public StateControl(GfxObject obj) { this.m_cStateWrap = new StateWrap(obj); this.m_cCurrentState = null; }