RuntimeReference<T, TVar>
Abstract base class that all other runtime references derive from.
Marked with the Serializable
attribute.
Description
Represents a value that can point to either a constant value T
or RuntimeVariable<T>
value.
Can be toggled at runtime to switch between these values.
Serialized Fields (Inspector)
useConstant : bool
- Whether the reference should point to the constant value or the variable value.constantValue : T
- The constant value to be used, whenuseConstant
istrue
.variable: TVar
- The variable value to be used, whenuseConstant
isfalse
.
Public Properties
UseConstant : bool
- (get, set) - Whether the reference should point to the constant value or the variable value.ConstantValue : T
- (get) - The constant value to be used, whenUseConstant
istrue
.Variable : TVar
(get) - The variable value to be used, whenUseConstant
isfalse
.
Public Methods
GetValue() : T
- Returns the current value, either of the constant value or variable value.SetValue(T)
- Sets the value of the variable to a new value. Has no effect whenUseConstant
istrue
.SetUseConstant(bool)
- Sets whether the reference should point to the constant value or the variable value.