示例#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>());
        }
示例#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> ());
        }
示例#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>());
        }
示例#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>();
        }
示例#6
0
 /// <summary>
 /// 是否存在该操作状态
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public bool HasOperate <T>() where T : OperateStateBase
 {
     return(fsm.HasState <T>());
 }
示例#7
0
 /// <summary>
 /// 是否存在流程。
 /// </summary>
 /// <typeparam name="T">要检查的流程类型。</typeparam>
 /// <returns>是否存在流程。</returns>
 public bool HasProcedure <T>() where T : ProcedureBase
 {
     return(fsm.HasState <T>());
 }