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, whenuseConstantistrue.variable: TVar- The variable value to be used, whenuseConstantisfalse.
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, whenUseConstantistrue.Variable : TVar(get) - The variable value to be used, whenUseConstantisfalse.
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 whenUseConstantistrue.SetUseConstant(bool)- Sets whether the reference should point to the constant value or the variable value.