protected virtual void fixedUpdate(float elapsedTime) { if (mFrameComponentUpdate == null) { return; } int count = mFrameComponentUpdate.Count; for (int i = 0; i < count; ++i) { // 因为在更新过程中也可能销毁所有组件,所以需要每次循环都要判断 if (mFrameComponentUpdate == null) { return; } FrameSystem component = mFrameComponentUpdate[i]; if (component != null && !component.isDestroy()) { #if UNITY_EDITOR || DEVELOPMENT_BUILD Profiler.BeginSample(component.getName()); #endif component.fixedUpdate(elapsedTime); #if UNITY_EDITOR || DEVELOPMENT_BUILD Profiler.EndSample(); #endif } } }
protected virtual void drawGizmos() { if (mFrameComponentUpdate == null) { return; } int count = mFrameComponentUpdate.Count; for (int i = 0; i < count; ++i) { // 因为在更新过程中也可能销毁所有组件,所以需要每次循环都要判断 if (mFrameComponentUpdate == null) { return; } FrameSystem component = mFrameComponentUpdate[i]; if (component != null && !component.isDestroy()) { component.onDrawGizmos(); } } }
protected virtual void lateUpdate(float elapsedTime) { if (mFrameComponentUpdate == null) { return; } int count = mFrameComponentUpdate.Count; for (int i = 0; i < count; ++i) { // 因为在更新过程中也可能销毁所有组件,所以需要每次循环都要判断 if (mFrameComponentUpdate == null) { return; } FrameSystem component = mFrameComponentUpdate[i]; if (component != null && !component.isDestroy()) { component.lateUpdate(elapsedTime); } } }