/// <summary>
        /// 初始化流程管理器。
        /// </summary>
        /// <param name="fsmManager">有限状态机管理器。</param>
        /// <param name="procedures">流程管理器包含的流程。</param>
        public void Initialize(IFsmManager fsmManager, params ProcedureBase[] procedures)
        {
            if (fsmManager == null)
            {
                throw new GameFrameworkException("FSM manager is invalid.");
            }

            m_FsmManager = fsmManager;
            m_FsmManager.DestroyFsm(typeof(IProcedureManager));
            m_ProcedureFsm = m_FsmManager.CreateFsm(this, procedures);
        }
Beispiel #2
0
        /// <summary>
        /// 关闭并清理流程管理器。
        /// </summary>
        internal override void Shutdown()
        {
            if (m_FsmManager != null)
            {
                if (m_ProcedureFsm != null)
                {
                    m_FsmManager.DestroyFsm <IProcedureManager>();
                    m_ProcedureFsm = null;
                }

                m_FsmManager = null;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 关闭并清理流程管理器。
        /// </summary>
        public override void OnDispose()
        {
            if (_fsmManager != null)
            {
                if (_stageFsm != null)
                {
                    _fsmManager.DestroyFsm(_stageFsm);
                    _stageFsm = null;
                }

                _fsmManager = null;
            }
        }
        /// <summary>
        /// 关闭并清理状态管理器
        /// </summary>
        public void ShutDown()
        {
            if (m_FsmManager != null)
            {
                if (m_StateFsm != null)
                {
                    m_FsmManager.DestroyFsm(m_StateFsm);
                    m_StateFsm = null;
                }

                m_FsmManager = null;
            }
        }
Beispiel #5
0
        /// <summary>
        /// 关闭并清理流程管理器。
        /// </summary>
        public void OnDestroy()
        {
            if (fsmManager != null)
            {
                if (fsm != null)
                {
                    fsmManager.DestroyFsm(fsm);
                    fsm = null;
                }

                fsmManager = null;
            }
        }
Beispiel #6
0
        public override bool Shutdown()
        {
            if (m_FsmManager != null)
            {
                if (m_ProcedureFsm != null)
                {
                    m_FsmManager.DestroyFsm(m_ProcedureFsm);
                    m_ProcedureFsm = null;
                }

                m_FsmManager = null;
            }
            return(base.Shutdown());
        }
Beispiel #7
0
 /// <summary>
 /// 销毁有限状态机。
 /// </summary>
 /// <typeparam name="T">有限状态机持有者类型。</typeparam>
 /// <returns>是否销毁有限状态机成功。</returns>
 public bool DestroyFsm <T>() where T : class
 {
     return(m_FsmManager.DestroyFsm <T>());
 }
 /// <summary>
 /// 销毁有限状态机。
 /// </summary>
 /// <typeparam name="T">有限状态机持有者类型。</typeparam>
 /// <param name="name">要销毁的有限状态机名称。</param>
 /// <returns>是否销毁有限状态机成功。</returns>
 public bool DestroyFsm <T>(string name) where T : class
 {
     return(m_FsmManager.DestroyFsm <T>(name));
 }