|
|
@ -15,7 +15,12 @@ namespace Fungus |
|
|
|
public class ColorVariable : VariableBase<Color> |
|
|
|
public class ColorVariable : VariableBase<Color> |
|
|
|
{ |
|
|
|
{ |
|
|
|
public static readonly CompareOperator[] compareOperators = { CompareOperator.Equals, CompareOperator.NotEquals }; |
|
|
|
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) { |
|
|
|
protected static bool ColorsEqual(Color a, Color b) { |
|
|
|
return ColorUtility.ToHtmlStringRGBA(a) == ColorUtility.ToHtmlStringRGBA(b); |
|
|
|
return ColorUtility.ToHtmlStringRGBA(a) == ColorUtility.ToHtmlStringRGBA(b); |
|
|
@ -48,6 +53,15 @@ namespace Fungus |
|
|
|
case SetOperator.Assign: |
|
|
|
case SetOperator.Assign: |
|
|
|
Value = value; |
|
|
|
Value = value; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case SetOperator.Add: |
|
|
|
|
|
|
|
Value += value; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case SetOperator.Subtract: |
|
|
|
|
|
|
|
Value -= value; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case SetOperator.Multiply: |
|
|
|
|
|
|
|
Value *= value; |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
Debug.LogError("The " + setOperator.ToString() + " set operator is not valid."); |
|
|
|
Debug.LogError("The " + setOperator.ToString() + " set operator is not valid."); |
|
|
|
break; |
|
|
|
break; |
|
|
|