private void CallUpdateMethodByType(int time, int methodType) { switch (methodType) { case TICKS_FIXED_UPDATE: if (mItem.IsFixedUpdate) { mFixedUpdateCountTime -= time; if (mFixedUpdateCountTime <= 0) { mItem.OnFixedUpdate(mFixedUpdateDeltaTime); mFixedUpdateCountTime += mFixedUpdateDeltaTime; } } break; case TICKS_UPDATE: if (mItem.IsUpdate) { mTicksLater?.Update(time); mItem?.OnUpdate(time); } break; case TICKS_LATE_UPDATE: if (mItem.IsLateUpdate) { mItem.OnLateUpdate(); } break; } }
public void LateUpdate() { if (IsDisposed) { return; } int max = mCacher.Count; for (int i = 0; i < max; i++) { mItem = mCacher[i]; if (mItem.IsLateUpdate) { mItem.OnLateUpdate(); } } mItem = default; }
public void LateUpdate() { if (IsDisposed) { return; } int max = mCacher.Count; for (int i = 0; i < max; i++) { mItem = mCacher[i]; if ((mItem != default) && mItem.IsLateUpdate) { mItem.OnLateUpdate(); } } mItem = default; int time = (int)(Time.fixedDeltaTime * UPDATE_CACHER_TIME_SCALE); mTicksLater.Update(time); }