PropertyInterface
Nectunia.PropertyInterface.TypedValue Class Reference

Detailed Description

Manage value with Tag.ValueType at runtime.

Inheritance diagram for Nectunia.PropertyInterface.TypedValue:

Properties

object Value [get, set]
 The Typed value as an Object. More...
 
string ValueSerialized [get]
 The Typed value as a serialized string. More...
 
Tag.ValueType ValueType [get, set]
 The Tag.ValueType of the Typed value. More...
 

Public Member Functions

bool CastValueToType ()
 Try to convert the Typed value to the current ValueType. More...
 
void ResetValues ()
 Set the default values for the current ValueType. More...
 
void RefreshValueObject ()
 Refresh the object value with the serializedValue More...
 
System.Object GetDefaultValue ()
 Get the default value for current valuesType More...
 
void OnBeforeSerialize ()
 Called before the value is serialized. More...
 
void OnAfterDeserialize ()
 Called after the value is deserialized. More...
 

Static Public Member Functions

static TypedValue operator+ (TypedValue a, TypedValue b)
 

Property Documentation

◆ Value

object Nectunia.PropertyInterface.TypedValue.Value
getset

The Typed value as an Object.

◆ ValueSerialized

string Nectunia.PropertyInterface.TypedValue.ValueSerialized
get

The Typed value as a serialized string.

◆ ValueType

Tag.ValueType Nectunia.PropertyInterface.TypedValue.ValueType
getset

The Tag.ValueType of the Typed value.

Member Function Documentation

◆ CastValueToType()

bool Nectunia.PropertyInterface.TypedValue.CastValueToType ( )

Try to convert the Typed value to the current ValueType.

Used when ValueType has changed to try to not loose the current Typed value.

Returns
True if the cast successed. False otherwise.

◆ GetDefaultValue()

System.Object Nectunia.PropertyInterface.TypedValue.GetDefaultValue ( )

Get the default value for current valuesType

Returns
The default value

◆ OnAfterDeserialize()

void Nectunia.PropertyInterface.TypedValue.OnAfterDeserialize ( )

Called after the value is deserialized.

OnAfterDeserialize is call only after a modification have been done on the SerializedProperty of the actual Object.

◆ OnBeforeSerialize()

void Nectunia.PropertyInterface.TypedValue.OnBeforeSerialize ( )

Called before the value is serialized.

Not used at present.

\ WARNING /!\: Be carefull it's call very ofen (20-30 time before Custom PropertyDrawer.OnGUI()

◆ operator+()

static TypedValue Nectunia.PropertyInterface.TypedValue.operator+ ( TypedValue  a,
TypedValue  b 
)
static

◆ RefreshValueObject()

void Nectunia.PropertyInterface.TypedValue.RefreshValueObject ( )

Refresh the object value with the serializedValue

◆ ResetValues()

void Nectunia.PropertyInterface.TypedValue.ResetValues ( )

Set the default values for the current ValueType.