Version 3.0.1.0

Odin has a dedicated attribute overview with examples

ShowIfGroupAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[Conditional("UNITY_EDITOR")]
public class ShowIfGroupAttribute : PropertyGroupAttribute, _Attribute

ShowIfGroup 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.

Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.

Inheritance

Constructors

ShowIfGroupAttribute(String, Boolean)
Makes a group that can be shown or hidden based on a condition.
public ShowIfGroupAttribute(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.

ShowIfGroupAttribute(String, Object, Boolean)
Makes a group that can be shown or hidden based on a condition.
public ShowIfGroupAttribute(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

Value
The optional member value.
public object Value

Properties

Animate
Whether or not to visually animate group visibility changes. Alias for AnimateVisibility.
public bool Animate { get; set; }
Condition
A resolved string that defines the condition to check the value of, such as a member name or an expression.
public string Condition { get; set; }

Methods

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

Another ShowIfGroup attribute.