public void Dispose() { IsDisposed = true; mAddItemNoticeName.Remove(OnAddItem); mRemoveItemNoticeName.Remove(OnRemoveItem); Utils.Reclaim(ref mCacher); Utils.Reclaim(ref mDeleted); Utils.Reclaim(mTicksLater); mTicksLater = default; mItem = default; }
public void Dispose() { mIsDisposed = true; ShipDockConsts.NOTICE_REMOVE_UPDATE.Remove(RemoveUpdate); ShipDockConsts.NOTICE_ADD_UPDATE.Remove(AddUpdate); Utils.Reclaim(ref mTicksList); Utils.Reclaim(ref mListDeleted); Utils.Reclaim(mTicksLater); Utils.Reclaim(mThreadTicks); mItem = null; mItemAdded = null; mItemRemoved = null; mNoticeAdded = null; mNoticeRemoved = null; mTicksLater = null; mThreadTicks = null; }
public TicksUpdater(int tickTime, float fixedUpdateTime = 0.3f) { FixedUpdateTime = fixedUpdateTime; mFixedUpdateDeltaTime = (int)(fixedUpdateTime * 1000); mFixedUpdateCountTime = mFixedUpdateDeltaTime; if (mThreadTicks == null) { mThreadTicks = new ThreadTicks(tickTime); mThreadTicks.Add(Updating); mThreadTicks.Start(); } else { } mTicksLater = new TicksLater(); mTicksList = new List <IUpdate>(); mListDeleted = new List <IUpdate>(); Enabled(); }
public UpdatesCacher(int addNoticeName, int removeNoticeName, int callLateNoticeName) { mCacher = new List <IUpdate>(); mDeleted = new List <IUpdate>(); mTicksLater = new TicksLater(); if (addNoticeName != int.MaxValue) { mAddItemNoticeName = addNoticeName; mAddItemNoticeName.Add(OnAddItem); } if (removeNoticeName != int.MaxValue) { mRemoveItemNoticeName = removeNoticeName; mRemoveItemNoticeName.Add(OnRemoveItem); } if (callLateNoticeName != int.MaxValue) { mCallLateNoticeName = callLateNoticeName; mCallLateNoticeName.Add(OnAddCallLate); } }