Пример #1
0
    public void StateUpdate()
    {
        if (asyncOperation != null && asyncOperation.isDone == false)//正在加载场景时,直接返回
        {
            return;
        }

        if (isRunStart == false)//如果加载完成场景,但是还未执行StateStart方法,执行StateStart方法
        {
            currentState.StateStart();
            isRunStart = true;
        }

        currentState.StateUpdate();//执行currentState的Update方法
    }
    /// <summary>
    /// 更新状态
    /// </summary>
    public void StateUpdate()
    {
        //判断是否还在加载
        if (isLoad)
        {
            return;
        }

        //通知新的State开始
        if (m_State != null && runBegin == false)
        {
            m_State.StateBegin();
            runBegin = true;
        }

        if (m_State != null && runBegin)
        {
            m_State.StateUpdate();
        }
    }