using Axibug.Fsm; using Axibug.Procedure; using Axibug.Runtime; using Game; using ProcedureBase = Axibug.Procedure.ProcedureBase; public class ProcedureInitRole : ProcedureBase { private bool m_IsInitSuccessful = false; //建议一些热更初始化相关的操作丢在这里 protected override void OnEnter(IFsm procedureOwner) { base.OnEnter(procedureOwner); Log.Debug("ProcedureInitRole::OnEnter"); GamePlayEntry.MainPlayer.LoadPlayer(); //TODO 一些初始化 管理 等等 m_IsInitSuccessful = true; } protected override void OnLeave(IFsm procedureOwner, bool isShutdown) { base.OnLeave(procedureOwner, isShutdown); } protected override void OnUpdate(IFsm procedureOwner, float elapseSeconds, float realElapseSeconds) { base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds); if (m_IsInitSuccessful) { ChangeState(procedureOwner); //TODO } } }