Namespace: | Sirenix.OdinInspector |
Assembly: | Sirenix.OdinInspector.Attributes |
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All)]
[DontApplyToListElements]
[Conditional("UNITY_EDITOR")]
public class DisableInPlayModeAttribute : Attribute, _Attribute
DisableInPlayMode is used on any property, and disables the property when in play mode.
Use this to prevent users from editing a property when in play mode.
The following example shows how DisableInPlayMode is used to disable a property when in play mode.
public class MyComponent : MonoBehaviour
{
[DisableInPlayMode]
public int MyInt;
}
public DisableInPlayModeAttribute()