diff --git a/Assets/Fungus/Scripts/VariableTypes/ColorVariable.cs b/Assets/Fungus/Scripts/VariableTypes/ColorVariable.cs index bbd7d824..eb30ba44 100644 --- a/Assets/Fungus/Scripts/VariableTypes/ColorVariable.cs +++ b/Assets/Fungus/Scripts/VariableTypes/ColorVariable.cs @@ -15,7 +15,12 @@ namespace Fungus public class ColorVariable : VariableBase { public static readonly CompareOperator[] compareOperators = { CompareOperator.Equals, CompareOperator.NotEquals }; - public static readonly SetOperator[] setOperators = { SetOperator.Assign }; + public static readonly SetOperator[] setOperators = { + SetOperator.Assign, + SetOperator.Add, + SetOperator.Subtract, + SetOperator.Multiply + }; protected static bool ColorsEqual(Color a, Color b) { return ColorUtility.ToHtmlStringRGBA(a) == ColorUtility.ToHtmlStringRGBA(b); @@ -48,6 +53,15 @@ namespace Fungus case SetOperator.Assign: Value = value; break; + case SetOperator.Add: + Value += value; + break; + case SetOperator.Subtract: + Value -= value; + break; + case SetOperator.Multiply: + Value *= value; + break; default: Debug.LogError("The " + setOperator.ToString() + " set operator is not valid."); break;