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
419 stars 23 forks source link

The bug pertains to the deregistration of a monitored object #22

Closed YuXya closed 7 months ago

YuXya commented 11 months ago

Script:

public class DrawShowUI { [Monitor] [MPosition(UIPosition.UpperRight)] [MGroupName("draw_line")] //[MGroupElement(false)] [MFontSize(16)] [MValueProcessor(nameof(SetUIDraw))] public string m_name;

public bool is_show;

public void OnLoad(string name, bool show)
{
    m_name = name;
    is_show = show;
    Monitor.StartMonitoring(this);
}

public void ClearUI()
{
    Monitor.StopMonitoring(this);
}

 private string SetUIDraw(string name)
{
    return name + ":" + is_show;
}

}

In the above code, the monitored fields within the grouped section are not successfully unmonitored. However, when replacing the grouped fields with non-grouped ones, the unmonitoring process works correctly.