Version 2.1.0.0

Odin has a dedicated attribute overview with examples

ShowGroupIfAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
public class ShowGroupIfAttribute : PropertyGroupAttribute, _Attribute

The ShowIfGroup is an attribute that allows for showing or hiding a group of properties based on a condition.

The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.

Inheritance

Constructors

ShowGroupIfAttribute(String, Boolean)
Makes a group that can be shown or hidden based on a condition.
public ShowGroupIfAttribute(string path, bool animate = true)
Parameters
System.String path

The group path.

System.Boolean animate

If true then a fade animation will be played when the group is hidden or shown.

ShowGroupIfAttribute(String, Object, Boolean)
Makes a group that can be shown or hidden based on a condition.
public ShowGroupIfAttribute(string path, object value, bool animate = true)
Parameters
System.String path

The group path.

System.Object value

The value the member should equal for the property to shown.

System.Boolean animate

If true then a fade animation will be played when the group is hidden or shown.

Fields

Animate
Whether or not to slide the properties in and out when the state changes.
public bool Animate
Value
The optional member value.
public object Value

Properties

MemberName
Name of member to use when to show the group. Defaults to the name of the group, by can be overriden by setting this property.
public string MemberName { get; set; }

Methods

CombineValuesWith(PropertyGroupAttribute)
Combines ShowIfGroup attributes.
protected override void CombineValuesWith(PropertyGroupAttribute other)
Parameters
PropertyGroupAttribute other

Another ShowIfGroup attribute.

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.