Esempio n. 1
0
        /// <summary>
        /// 是否存在流程。
        /// </summary>
        /// <typeparam name="T">要检查的流程类型。</typeparam>
        /// <returns>是否存在流程。</returns>
        public bool HasProcedure <T>() where T : ProcedureBase
        {
            if (m_ProcedureFsm == null)
            {
                throw new GameFrameworkException("You must initialize procedure first.");
            }

            return(m_ProcedureFsm.HasState <T>());
        }
Esempio n. 2
0
        /// <summary>
        /// 是否存在流程。
        /// </summary>
        /// <typeparam name="T">要检查的流程类型。</typeparam>
        /// <returns>是否存在流程。</returns>
        public bool Exists <T>() where T : StageBase
        {
            if (_stageFsm == null)
            {
                throw new GameException("You must initialize procedure first.");
            }

            return(_stageFsm.HasState <T>());
        }
        /// <summary>
        /// 是否存在状态
        /// </summary>
        /// <typeparam name="T">要检查的状态类型.</typeparam>
        public bool HasState <T>() where T : CharacterStateBase
        {
            if (m_StateFsm == null)
            {
                throw new GameFrameworkException("You must initialize states first.");
            }

            return(m_StateFsm.HasState <T> ());
        }
Esempio n. 4
0
        /// <summary>
        /// 是否存在流程。
        /// </summary>
        /// <typeparam name="T">要检查的流程类型。</typeparam>
        /// <returns>是否存在流程。</returns>
        public bool HasProcedure <T>() where T : ProcedureBase
        {
            if (m_ProcedureFsm == null)
            {
                Logger.LogError("You must initialize procedure first.");
            }

            return(m_ProcedureFsm.HasState <T>());
        }
Esempio n. 5
0
        public virtual void ChangeState <T>(ICommand command = null) where T : ActorFsmStateBase
        {
            if (m_ActorFsm == null)
            {
                Log.Error("Please set ActorFsm first");
                return;
            }

            if (!m_ActorFsm.HasState <T>())
            {
                Log.Error("Can no find state" + typeof(T));
                return;
            }

            ActorFsmStateBase state = m_ActorFsm.GetState <T>();

            if (CurFsmStateType == ActorFsmStateType.FSM_DEAD && state.StateType != ActorFsmStateType.FSM_REBORN)
            {
                return;
            }

            m_ActorFsm.GetState <T>().SetCommand(command);
            state.ChangeState <T>();
        }
Esempio n. 6
0
 /// <summary>
 /// 是否存在该操作状态
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public bool HasOperate <T>() where T : OperateStateBase
 {
     return(fsm.HasState <T>());
 }
Esempio n. 7
0
 /// <summary>
 /// 是否存在流程。
 /// </summary>
 /// <typeparam name="T">要检查的流程类型。</typeparam>
 /// <returns>是否存在流程。</returns>
 public bool HasProcedure <T>() where T : ProcedureBase
 {
     return(fsm.HasState <T>());
 }