/// <summary> /// 初始化流程管理器。 /// </summary> /// <param name="fsmManager">有限状态机管理器。</param> /// <param name="procedures">流程管理器包含的流程。</param> public void Initialize(FsmManager fsmManager, params ProcedureBase[] procedures) { if (fsmManager == null) { throw new GameFrameworkException("FSM manager is invalid."); } m_FsmManager = fsmManager; m_ProcedureFsm = m_FsmManager.CreateFsm(this, procedures); }
/// <summary> /// 关闭并清理流程管理器。 /// </summary> public void Shutdown() { if (m_FsmManager != null) { if (m_ProcedureFsm != null) { m_FsmManager.DestroyFsm(m_ProcedureFsm); m_ProcedureFsm = null; } m_FsmManager = null; } }
public void Start() { Debug.Log("热更新层启动!"); m_FsmManager = new FsmManager(); m_ProcedureManager = new ProcedureManager(); //初始化流程管理器并开始流程 m_ProcedureManager.Initialize(m_FsmManager , new ProcedureHotfixEntry() , new ProcedureChangeScene() , new ProcedureHotfixTest() ); m_ProcedureManager.StartProcedure <ProcedureHotfixEntry>(); }
public static void Start() { Log.Info("热更新层启动!"); Fsm = new FsmManager(); Procedure = new ProcedureManager(); Event = new EventManager(); ETNetwork = new ETNetworkManager(); //初始化ET网络 ETNetwork.Init(); //初始化流程管理器 //TODO:可修改为使用反射获取到所有流程然后注册 Procedure.Initialize(Fsm , new ProcedureHotfixEntry() , new ProcedureChangeScene() ); //开始热更新层入口流程 Procedure.StartProcedure <ProcedureHotfixEntry>(); }
/// <summary> /// 初始化流程管理器的新实例。 /// </summary> public ProcedureManager() { m_FsmManager = null; m_ProcedureFsm = null; }