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

(Troubleshooting Suggestion): GUI will not show on run #6

Closed fromanan closed 2 years ago

fromanan commented 2 years ago

Unity Version: 2021.3.5f1 (LTS) Project Base: 3D

FIX In Settings -> Player: Switched scripting backend to IL2CPP and API Compatibility Level to .NET Framework

JohnBaracuda commented 2 years ago

Hey, I couldn't reproduce the issue.

Test Configuration: Asset Release: 1.2.1 Unity Version: 2021.3.5f1 (LTS) Project Base: 3D Scripting Backend: both IL2CPP & Mono Api Compatibility Level: both .NET Standard 2.1 & .NET Framework

Test script:

using System;
using Baracuda.Monitoring;

public class TestBehaviour : MonitoredBehaviour
{
    [Monitor] private bool _instanceField = true;
    [Monitor] private int InstanceProperty { get; set; }
    [Monitor] private event Action InstanceEvent;

    [Monitor] private static int staticField = 234;
    [Monitor] private static string StaticProperty { get; } = "Hello World";
    [Monitor] private static event Action<bool> StaticEvent;

    private void Update()
    {
        staticField++;
        InstanceProperty++;
        _instanceField = InstanceProperty % 2 == 0;
    }

    protected override void Awake()
    {
        base.Awake();
        InstanceEvent += delegate {  };
        StaticEvent += delegate(bool b) {  };
    }
}

I also tested every configuration in the editor and in a packaged build (altough changing Mono to IL2CPP wont have any affect when testing in the editor because the editor will always use Mono) Everything worked as expected. Can you give me some more information. A look at the scipt with the monitored members, if you tested in the editor or in a packaged build etc. Thank you ;)