This attribute can mark its field as readonly in the inspector if
the condition is false.
using BaseTool;
using UnityEngine;
public class MyClass : MonoBehaviour
{
public bool IsStrong = true;
[EnableIf(nameof(IsStrong))]
public float Strength = 10f;
[EnableIf("!IsStrong")]
public float NonStrength = 10f;
}
DisableIfAttribute
This attribute can mark its field as readonly in the inspector if
the condition is true.
using BaseTool;
using UnityEngine;
public class MyClass : MonoBehaviour
{
public bool IsStrong = true;
[DisableIf("!IsStrong")]
public float Strength = 10f;
[DisableIf(nameof(IsStrong))]
public float NonStrength = 10f;
}
EnableIfAttribute
This attribute can mark its field as readonly in the inspector if the condition is false.
DisableIfAttribute
This attribute can mark its field as readonly in the inspector if the condition is true.