Odin has a dedicated attribute overview with examples

DisableInPlayModeAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field)]
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.

  • System.Object
  • System.Attribute
  • DisableInPlayModeAttribute

The following example shows how DisableInPlayMode is used to disable a property when in play mode.

public class MyComponent : MonoBehaviour
	public int MyInt;


public DisableInPlayModeAttribute()

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.