Refactor set variable system, add setting of GameObjects
The intent of this refactor is to reduce boilerplate code in the SetVariable.cs and
SetVariableEditor.cs files. Additionaly, the intent is to move variable specific
information from the SetVariable.cs file into the Variable.cs and the respecting
variable type files.
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
usingUnityEngine;
usingUnityEngine;
usingSystem.Collections.Generic;
namespaceFungus
namespaceFungus
{
{
/// <summary>
/// Mathematical operations that can be performed on variables.
/// </summary>
publicenumSetOperator
{
/// <summary> = operator. </summary>
Assign,
/// <summary> =! operator. </summary>
Negate,
/// <summary> += operator. </summary>
Add,
/// <summary> -= operator. </summary>
Subtract,
/// <summary> *= operator. </summary>
Multiply,
/// <summary> /= operator. </summary>
Divide
}
/// <summary>
/// <summary>
/// Sets a Boolean, Integer, Float or String variable to a new value using a simple arithmetic operation. The value can be a constant or reference another variable of the same type.
/// Sets a Boolean, Integer, Float or String variable to a new value using a simple arithmetic operation. The value can be a constant or reference another variable of the same type.
/// </summary>
/// </summary>
@ -37,7 +19,8 @@ namespace Fungus
[VariableProperty(typeof(BooleanVariable),
[VariableProperty(typeof(BooleanVariable),
typeof(IntegerVariable),
typeof(IntegerVariable),
typeof(FloatVariable),
typeof(FloatVariable),
typeof(StringVariable))]
typeof(StringVariable),
typeof(GameObjectVariable))]
[SerializeField]protectedVariablevariable;
[SerializeField]protectedVariablevariable;
[Tooltip("The type of math operation to be performed")]
[Tooltip("The type of math operation to be performed")]