protected void LateUpdate() { float deltaTime = Time.deltaTime; int frameCount = Time.frameCount; for (int iBehaviour = 0; iBehaviour < m_BehavioursForTraverse.Count; iBehaviour++) { BaseBehaviour iterBehaviour = m_BehavioursForTraverse[iBehaviour]; if (!iterBehaviour.CanUpdate()) { continue; } float behaviourDeltaTime; if (iterBehaviour.HasFeature(FeatureFlag.LateUpdateFrequency)) { try { if (!iterBehaviour.ControlLateUpdateFrequency(out behaviourDeltaTime, deltaTime, frameCount)) { continue; } } catch (Exception e) { MDebug.LogError("Core" , $"Execute {iterBehaviour.GetName()}.ControlLateUpdateFrequency Exception:{e.ToString()}"); continue; } } else { behaviourDeltaTime = deltaTime; } try { MDebug.LogVerbose("Core" , $"Before execute {iterBehaviour.GetName()}.OnLateUpdate"); iterBehaviour.OnLateUpdate(deltaTime); MDebug.LogVerbose("Core" , $"After execute {iterBehaviour.GetName()}.OnLateUpdate"); } catch (Exception e) { MDebug.LogError("Core" , $"Execute {iterBehaviour.GetName()}.OnLateUpdate Exception:{e.ToString()}"); } } EndFrame(); }