[OnGUIChanged]

Attribute used for invoking a method when the GUI is modified.

Examples

[Title("Change Detection")]
[OnGUIChanged(nameof(OnValueModified))]
public float monitoredValue = 1f;

[OnGUIChanged(nameof(OnNameModified))]
public string monitoredName = "Name";

[ReadOnly]
public int changeCount = 0;

private void OnValueModified()
{
    changeCount++;
    Debug.Log($"Value changed to: {monitoredValue}");
}

private void OnNameModified()
{
    changeCount++;
    Debug.Log($"Name changed to: {monitoredName}");
}