Example #1
0
 public void RemoveUpdate(Action <int> method)
 {
     if (mUpdaterMapper.ContainsKey(method))
     {
         MethodUpdater updater = mUpdaterMapper.GetValue(method, true);
         UpdaterNotice.RemoveSceneUpdater(updater);
         updater.Dispose();
     }
     else
     {
     }
 }
Example #2
0
 public void AddUpdate(Action <int> method)
 {
     if (!mUpdaterMapper.ContainsKey(method))
     {
         MethodUpdater updater = new MethodUpdater
         {
             Update = method
         };
         mUpdaterMapper[method] = updater;
         UpdaterNotice.AddSceneUpdater(updater);
     }
     else
     {
     }
 }
Example #3
0
 public void AddLateUpdate(Action method)
 {
     if (!mLateUpdaterMapper.ContainsKey(method))
     {
         MethodUpdater updater = new MethodUpdater
         {
             LateUpdate   = method,
             IsLateUpdate = true,
             IsUpdate     = false,
         };
         mLateUpdaterMapper[method] = updater;
         UpdaterNotice.AddSceneUpdater(updater);
     }
     else
     {
     }
 }
Example #4
0
 private void OnStateFrameUpdater(IState state, bool isAdd)
 {
     if (isAdd)
     {
         if (!mStateUpdaters.IsContainsKey(state))
         {
             MethodUpdater updater = new MethodUpdater
             {
                 Update = state.UpdateState
             };
             mStateUpdaters[state] = updater;
             UpdaterNotice.AddSceneUpdater(updater);
         }
     }
     else
     {
         IUpdate updater = mStateUpdaters[state];
         UpdaterNotice.RemoveSceneUpdater(updater);
     }
 }
Example #5
0
        private void OnSceneUpdateReady(INoticeBase <int> obj)
        {
            ShipDockConsts.NOTICE_SCENE_UPDATE_READY.Remove(OnSceneUpdateReady);

            MethodUpdater updater = ShipDockComponentManagerSetting.isMergeUpdateMode ?
                                    new MethodUpdater
            {
                Update = MergeComponentUpdateModeInScene
            } :
            new MethodUpdater
            {
                Update = SingleFrameComponentUpdateModeInScene
            };

            UpdaterNotice notice = Pooling <UpdaterNotice> .From();

            notice.ParamValue = updater;
            ShipDockConsts.NOTICE_ADD_SCENE_UPDATE.Broadcast(notice);
            Pooling <UpdaterNotice> .To(notice);
        }
Example #6
0
 private void OnFSMFrameUpdater(IStateMachine fsm, bool isAdd)
 {
     if (mFSMUpdaters == default)
     {
         return;
     }
     if (isAdd)
     {
         MethodUpdater updater = new MethodUpdater
         {
             Update = fsm.UpdateState
         };
         mFSMUpdaters[fsm] = updater;
         UpdaterNotice.AddSceneUpdater(updater);
     }
     else
     {
         IUpdate updater = mFSMUpdaters[fsm];
         UpdaterNotice.RemoveSceneUpdater(updater);
     }
 }
Example #7
0
 private void OnFSMFrameUpdater(IStateMachine fsm, bool isAdd)
 {
     if (isAdd)
     {
         if (!mFSMUpdaters.ContainsKey(fsm))
         {
             MethodUpdater updater = new MethodUpdater
             {
                 Update = fsm.UpdateState
             };
             mFSMUpdaters[fsm] = updater;
             UpdaterNotice.AddSceneUpdater(updater);
         }
         else
         {
         }
     }
     else
     {
         IUpdate updater = mFSMUpdaters.GetValue(fsm, true);
         UpdaterNotice.RemoveSceneUpdater(updater);
     }
 }
Example #8
0
        private void OnServersInit()
        {
            Components = new ShipDockComponentManager
            {
                FrameTimeInScene = (int)(UnityEngine.Time.deltaTime * 1000)
            };

            MethodUpdater updater = ShipDockComponentManagerSetting.isMergeUpdateMode ?
                                    new MethodUpdater
            {
                Update = MergeComponentUpdateMode
            } :
            new MethodUpdater
            {
                Update = SingleFrameComponentUpdateMode
            };
            UpdaterNotice notice = Pooling <UpdaterNotice> .From();

            notice.ParamValue = updater;
            ShipDockConsts.NOTICE_ADD_UPDATE.Broadcast(notice);
            Pooling <UpdaterNotice> .To(notice);

            ShipDockConsts.NOTICE_SCENE_UPDATE_READY.Add(OnSceneUpdateReady);
        }