Ejemplo n.º 1
0
        private void StartUpdateResources(object userData)
        {
            if (m_UpdateResourceForm == null)
            {
                m_UpdateResourceForm = Object.Instantiate(GameEntry.Config.UpdateResourceFormTemplate);
            }

            GameEntry.Resource.UpdateResources();
            Log.Info("Start update resources...");
        }
Ejemplo n.º 2
0
        protected override void OnLeave(ProcedureOwner procedureOwner, bool isShutdown)
        {
            if (m_UpdateResourceForm != null)
            {
                Object.Destroy(m_UpdateResourceForm.gameObject);
                m_UpdateResourceForm = null;
            }

            GameEntry.Event.Unsubscribe(ResourceCheckCompleteEventArgs.EventId, OnResourceCheckComplete);
            GameEntry.Event.Unsubscribe(ResourceUpdateStartEventArgs.EventId, OnResourceUpdateStart);
            GameEntry.Event.Unsubscribe(ResourceUpdateChangedEventArgs.EventId, OnResourceUpdateChanged);
            GameEntry.Event.Unsubscribe(ResourceUpdateSuccessEventArgs.EventId, OnResourceUpdateSuccess);
            GameEntry.Event.Unsubscribe(ResourceUpdateFailureEventArgs.EventId, OnResourceUpdateFailure);
            GameEntry.Event.Unsubscribe(ResourceUpdateAllCompleteEventArgs.EventId, OnResourceUpdateAllComplete);

            base.OnLeave(procedureOwner, isShutdown);
        }
Ejemplo n.º 3
0
        protected override void OnEnter(ProcedureOwner procedureOwner)
        {
            base.OnEnter(procedureOwner);

            m_UpdateAllComplete    = false;
            m_UpdateCount          = 0;
            m_UpdateTotalZipLength = 0;
            m_UpdateSuccessCount   = 0;
            m_UpdateLengthData.Clear();
            m_UpdateResourceForm = null;

            GameEntry.Event.Subscribe(ResourceCheckCompleteEventArgs.EventId, OnResourceCheckComplete);
            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.Event.Subscribe(ResourceUpdateAllCompleteEventArgs.EventId, OnResourceUpdateAllComplete);

            GameEntry.Resource.CheckResources();
        }