Language
Edit

DrawIfAttribute Class

Definition

Conditionally draws a property or field.

[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=true)]
public sealed class DrawIfAttribute : UnityEngine.PropertyAttribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=true)>]
type DrawIfAttribute = class
    inherit PropertyAttribute
Public NotInheritable Class DrawIfAttribute
Inherits PropertyAttribute
Inheritance
UnityEngine.PropertyAttribute
DrawIfAttribute
Attributes

Remarks

Based on https://forum.unity.com/threads/draw-a-field-only-if-a-condition-is-met.448855/

Constructors

Name Description
DrawIfAttribute(String, Object, DrawIfAttribute+ComparisonType)

Only draws the field only if the provided property's boolValue matches the compared value.

Properties

Name Description
CompareAgainst

The value to compare against.

ComparedPropertyName

The serialized name of the property to compare.

ComparisonMode

The comparison to perform.

Applies to