//开始更新资源 private void StartUpdateResources(object userData) { if (m_UpdateResourceForm == null) { m_UpdateResourceForm = Object.Instantiate(GameEntry.BuiltinData.UpdateResourceFormTemplate); } Log.Info("Start update resources..."); Log.Info("Start update resource group 'Base' ..."); GameEntry.Resource.UpdateResources("Base", OnUpdateResourcesComplete); //先更新Base资源 }
protected override void OnLeave(IFsm <IProcedureManager> procedureOwner, bool isShutdown) { base.OnLeave(procedureOwner, isShutdown); //删除更新资源的界面 if (m_UpdateResourceForm != null) { Object.Destroy(m_UpdateResourceForm.gameObject); m_UpdateResourceForm = null; } //反注册事件 GameEntry.Event.Unsubscribe(ResourceUpdateStartEventArgs.EventId, OnResourceUpdateStart); GameEntry.Event.Unsubscribe(ResourceUpdateChangedEventArgs.EventId, OnResourceUpdateChanged); GameEntry.Event.Unsubscribe(ResourceUpdateSuccessEventArgs.EventId, OnResourceUpdateSuccess); GameEntry.Event.Unsubscribe(ResourceUpdateFailureEventArgs.EventId, OnResourceUpdateFailure); }
protected override void OnEnter(IFsm <IProcedureManager> procedureOwner) { base.OnEnter(procedureOwner); m_UpdateAllComplete = false; m_UpdateCount = 0; m_RemoveCount = 0; m_UpdateTotalLength = 0L; m_UpdateTotalZipLength = 0L; m_UpdateSuccessCount = 0; m_UpdateLengthData.Clear(); m_UpdateResourceForm = null; //注册事件 GameEntry.Event.Subscribe(ResourceUpdateStartEventArgs.EventId, OnResourceUpdateStart); GameEntry.Event.Subscribe(ResourceUpdateChangedEventArgs.EventId, OnResourceUpdateChanged); GameEntry.Event.Subscribe(ResourceUpdateSuccessEventArgs.EventId, OnResourceUpdateSuccess); GameEntry.Event.Subscribe(ResourceUpdateFailureEventArgs.EventId, OnResourceUpdateFailure); GameEntry.Resource.CheckResources(OnCheckResourcesComplete); //检查资源 }