JohnBaracuda / com.baracuda.runtime-monitoring

Runtime Monitoring is an easy way for you to monitor the value or state of custom C# members during runtime. Just add the 'Monitor' attribute to a field, property, event, method or even class and get its value or state displayed automatically in a customizable and extendable debug UI.
MIT License
408 stars 22 forks source link

Add update rate option to settings #23

Closed haywirephoenix closed 5 months ago

haywirephoenix commented 6 months ago

SceneHook causes my debug capsules in scene view to draw erratically when it invokes the LateUpdateEvent. Same result when using the TMP UI. Commenting out the event in lateupdate and adding the below fixes the problem.

 private void FixedUpdate()
        {
            LateUpdateEvent?.Invoke(Time.fixedDeltaTime);
        }

Adding an update rate option to the settings will allow people to select what rate works for them. Excellent work with this asset.

haywirephoenix commented 6 months ago

To replicate, use the (free) Physics Debug Extension by RotaryHeart and draw a debug CapsuleCast during FixedUpdate on a moving object while runtime-monitoring is displaying using the [Monitor] attribute.

Physics.CapsuleCast(capsuleBottom, capsuleTop, capsuleRadius, direction, out RaycastHit hit, maxDistance, GroundLayers.value, PreviewCondition.Editor, 0f, Color.blue, Color.white, false, CastDrawType.Minimal);

At it's core it only uses Debug.Draw when drawing in the editor so it can be an issue outside of this asset also.