Exemplo n.º 1
0
        /// <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();
        }
Exemplo n.º 2
0
        /// <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();
        }
Exemplo n.º 3
0
        /// <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();
        }
Exemplo n.º 4
0
        private StateWrap m_cStateWrap; //状态包对象

        #endregion Fields

        #region Constructors

        public StateControl(GfxObject obj)
        {
            this.m_cStateWrap = new StateWrap(obj);
            this.m_cCurrentState = null;
        }
Exemplo n.º 5
0
        /// <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();
        }
Exemplo n.º 6
0
 public StateControl(GfxObject obj)
 {
     this.m_cStateWrap    = new StateWrap(obj);
     this.m_cCurrentState = null;
 }