SetVariable
Method
SetVariable has 2 overloads.
SetVariable(byte, object)
Same as but with an object type. Provided for convenience.
SetVariable<T>(byte, T)
Set the value of, or create a variable on the space object. Requires the local actor to have ownership of the object. Note that depending on the context, setting a variable may not be instantaneous but it will always be performed in the same frame.
Parameters
Parameter | Description |
---|---|
byte id | The id of the variable to set or create. It is recommended to use an enum of type byte to define variables. |
T value | The value of the variable (supported types: int, bool, float, Vector2, Vector3, string, Color32, byte, double, long, int[]) |