Photon Fusion 2.0.0

Public Member Functions | Public Attributes | Properties | List of all members
DrawIfAttribute Class Reference

Editor attribute for selectively drawing/hiding fields. Condition member can be a property, field or method (with a return value). More...

Inherits DoIfAttributeBase.

Public Member Functions

 DrawIfAttribute (string propertyPath)
 
 DrawIfAttribute (string propertyPath, bool compareToValue, CompareOperator compare=CompareOperator.Equal, DrawIfMode mode=DrawIfMode.ReadOnly)
 Constructor.
 
 DrawIfAttribute (string propertyPath, double compareToValue, CompareOperator compare=CompareOperator.Equal, DrawIfMode mode=DrawIfMode.ReadOnly)
 Constructor.
 
 DrawIfAttribute (string propertyPath, long compareToValue, CompareOperator compare=CompareOperator.Equal, DrawIfMode mode=DrawIfMode.ReadOnly)
 

Public Attributes

DrawIfMode Mode
 Instructs the attribute completely hide the field if not draw, rather than the default of just disabling it.
 
- Public Attributes inherited from DoIfAttributeBase
double _doubleValue
 
bool _isDouble
 
long _longValue
 
CompareOperator Compare
 
string ConditionMember
 
bool ErrorOnConditionMemberNotFound = true
 

Properties

bool Hide [get, set]
 

Additional Inherited Members

- Protected Member Functions inherited from DoIfAttributeBase
 DoIfAttributeBase (string propertyPath, double compareToValue, CompareOperator compare)
 
 DoIfAttributeBase (string propertyPath, long compareToValue, CompareOperator compare)
 

Detailed Description

Editor attribute for selectively drawing/hiding fields. Condition member can be a property, field or method (with a return value).

Value of condition method is converted to a long. Null = 0, False = 0, True = 1, Unity Object = InstanceId

Constructor & Destructor Documentation

◆ DrawIfAttribute() [1/2]

DrawIfAttribute ( string  propertyPath,
double  compareToValue,
CompareOperator  compare = CompareOperator::Equal,
DrawIfMode  mode = DrawIfMode::ReadOnly 
)

Constructor.

Parameters
propertyPathCondition member can be a property, field or method (with a return value).

Value of condition method is converted to a long. Null = 0, False = 0, True = 1, Unity Object = InstanceId

Parameters
compareToValueThe value to compare the member value against.
modeHow the field should be hidden (disabled or removed)
compareHow the condition member value and compareToValye will be evaluated.

◆ DrawIfAttribute() [2/2]

DrawIfAttribute ( string  propertyPath,
bool  compareToValue,
CompareOperator  compare = CompareOperator::Equal,
DrawIfMode  mode = DrawIfMode::ReadOnly 
)

Constructor.

Parameters
propertyPathCondition member can be a property, field or method (with a return value).

Value of condition method is converted to a long. Null = 0, False = 0, True = 1, Unity Object = InstanceId

Parameters
compareToValueThe value to compare the member value against.
compareHow the condition member value and compareToValye will be evaluated.
modeHow the field should be hidden (disabled or removed)