Beispiel #1
0
    /// <summary>
    /// 切换状态并清空参数.
    /// </summary>
    /// <param name="state"></param>
    private void switch2State(ActionSkillState state)
    {
        if (state != mState)
        {
            mState      = state;
            mStateTimer = 0;

            SkillClientBehaviour.RemoveAll(mOwner, mLoopClientBehaviours);
            mTaskManager.Stop();
        }
    }
Beispiel #2
0
    /// <summary>
    /// 检查可否从当前状态转移到otherState.
    /// 准备阶段不检查距离, 使用阶段检查.
    /// </summary>
    private ErrorCode canEnterState(ActionSkillState otherState, Vector3 targetPosition)
    {
        if (otherState == mState)
        {
            return(ErrorCode.LogicError);
        }

        // 只能从invalid状态进入charge.
        if (otherState == ActionSkillState.Charging && mState != ActionSkillState.Invalid)
        {
            return(ErrorCode.LogicError);
        }

        //
        return(ErrorCode.Succeeded);
    }