Closed PooperPig closed 5 months ago
I think this is just an issue with the documentation. It should use the nameof() keyword to pass in the name of the monitor bool instead of passing in the bool directly. This should work:
[Monitor]
[MShowIf(nameof(monitor))]
private bool IsAlive { get; }
[SerializeField] private bool monitor = true;
Brilliant, I'll give it a go.
On Sat, Jun 1, 2024, 5:29 PM John Baracuda @.***> wrote:
I think this is just an issue with the documentation. It should use the nameof() keyword to pass in the name of the monitor bool instead of passing in the bool directly. This should work:
[Monitor][MShowIf(nameof(monitor))]private bool IsAlive { get; } [SerializeField] private bool monitor = true;
— Reply to this email directly, view it on GitHub https://github.com/JohnBaracuda/com.baracuda.runtime-monitoring/issues/29#issuecomment-2143341226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASMXYKILZW4I6CL7RSMRETZFFZ4RAVCNFSM6AAAAABIT3ZK2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTGM2DCMRSGY . You are receiving this because you authored the thread.Message ID: @.*** com>
I took the code from the documentation public class PlayerAccelerate : MonoBehaviour
which gives me an error on the 'monitor' field "An object reference is required for the non-static field, method, or property 'PlayerAccelerate.monitor'"
It would be great if it did work, as I want to be able to turn monitoring on and off for various classes in my game...