Odin has a dedicated attribute overview with examples

HideMonoScriptAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class HideMonoScriptAttribute : Attribute, _Attribute
Apply HideMonoScript to your class to prevent the Script property from being shown in the inspector.

This attribute has the same effect on a single type that the global configuration option "Show Mono Script In Editor" in "Preferences -> Odin Inspector -> General -> Drawers" has globally when disabled.

  • System.Object
  • System.Attribute
  • HideMonoScriptAttribute

The following example shows how to use this attribute.

public class MyComponent : MonoBehaviour
    // The Script property will not be shown for this component in the inspector
See Also
  • System.Attribute


public HideMonoScriptAttribute()