Version 2.1.11

Odin has a dedicated attribute overview with examples

ShowInInspectorAttribute class

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, AllowMultiple = false, Inherited = false)]
public class ShowInInspectorAttribute : Attribute, _Attribute

ShowInInspector is used on any member, and shows the value in the inspector. Note that the value being shown due to this attribute DOES NOT mean that the value is being serialized.

  • System.Object
  • System.Attribute
  • ShowInInspectorAttribute

This can for example be combined with ReadOnlyAttribute to allow for live debugging of values.



The following example shows how ShowInInspector is used to show properties in the inspector, that otherwise wouldn't.

public class MyComponent : MonoBehaviour
	private int myField;

	public int MyProperty { get; set; }


public ShowInInspectorAttribute()