public void LateUpdate() { while (this.lateUpdates.Count > 0) { Disposer disposer = this.lateUpdates.Dequeue(); if (disposer.Id == 0) { continue; } if (!this.disposerEvents.TryGetValue(disposer.GetType(), out IObjectEvent objectEvent)) { continue; } this.lateUpdates2.Enqueue(disposer); ILateUpdate iLateUpdate = objectEvent as ILateUpdate; if (iLateUpdate == null) { continue; } objectEvent.Set(disposer); try { iLateUpdate.LateUpdate(); } catch (Exception e) { Log.Error(e.ToString()); } } ObjectHelper.Swap(ref this.lateUpdates, ref this.lateUpdates2); }
public void LateUpdate(float deltaTime) { while (this.lateUpdates.Count > 0) { ECS_Disposer disposer = this.lateUpdates.Dequeue(); if (disposer.Id == 0) { continue; } IObjectEvent objectEvent; if (!this.disposerEvents.TryGetValue(disposer.GetType(), out objectEvent)) { continue; } this.lateUpdates2.Enqueue(disposer); ILateUpdate iLateUpdate = objectEvent as ILateUpdate; if (iLateUpdate == null) { continue; } objectEvent.Set(disposer); #if UNITY_EDITOR iLateUpdate.LateUpdate(deltaTime); #else try { iLateUpdate.LateUpdate(deltaTime); } catch (Exception e) { Logger.LogError(e.ToString()); } #endif } ObjectHelper.Swap(ref this.lateUpdates, ref this.lateUpdates2); }
public void LateUpdate() { unique.Clear(); while (this.lateUpdates.Count > 0) { ObjectDisposer disposer = this.lateUpdates.Dequeue(); if (disposer.IsDispose) { continue; } if (!this.unique.Add(disposer)) { continue; } IObjectEventFacade objectSystem; if (!this.disposerEvents.TryGetValue(disposer.GetType(), out objectSystem)) { continue; } this.lateUpdates2.Enqueue(disposer); ILateUpdate iLateUpdate = objectSystem as ILateUpdate; if (iLateUpdate == null) { continue; } objectSystem.Set(disposer); try { iLateUpdate.LateUpdate(); } catch (Exception e) { Logger.LogError(e.ToString()); } } ObjectHelper.Swap(ref this.lateUpdates, ref this.lateUpdates2); }
private void LateUpdate() { _lateUpdate?.LateUpdate(); }