DrawIfAttribute Class Reference

Draws the field/property ONLY if the compared property compared by the comparison type with the value of comparedValue returns true. Based on: https://forum.unity.com/threads/draw-a-field-only-if-a-condition-is-met.448855/ More...

Inheritance diagram for DrawIfAttribute:

Public Types

enum  DisablingType { DisablingType.ReadOnly = 2, DisablingType.DontDraw = 3 }
 Types of comparisons. More...
 

Public Member Functions

 DrawIfAttribute (string comparedPropertyName, object comparedValue, DisablingType disablingType=DisablingType.DontDraw)
 Only draws the field only if a condition is met. Supports enum and bools. More...
 

Properties

string comparedPropertyName [get]
 
object comparedValue [get]
 
DisablingType disablingType [get]
 

Detailed Description

Draws the field/property ONLY if the compared property compared by the comparison type with the value of comparedValue returns true. Based on: https://forum.unity.com/threads/draw-a-field-only-if-a-condition-is-met.448855/

Member Enumeration Documentation

◆ DisablingType

Types of comparisons.

Enumerator
ReadOnly 
DontDraw 

Constructor & Destructor Documentation

◆ DrawIfAttribute()

DrawIfAttribute.DrawIfAttribute ( string  comparedPropertyName,
object  comparedValue,
DisablingType  disablingType = DisablingType.DontDraw 
)

Only draws the field only if a condition is met. Supports enum and bools.

Parameters
comparedPropertyNameThe name of the property that is being compared (case sensitive).
comparedValueThe value the property is being compared to.
disablingTypeThe type of disabling that should happen if the condition is NOT met. Defaulted to DisablingType.DontDraw.

Property Documentation

◆ comparedPropertyName

string DrawIfAttribute.comparedPropertyName
get

◆ comparedValue

object DrawIfAttribute.comparedValue
get

◆ disablingType

DisablingType DrawIfAttribute.disablingType
get

The documentation for this class was generated from the following file: