|
|
@ -15,7 +15,7 @@ namespace Fungus |
|
|
|
public class Vector2Variable : VariableBase<Vector2> |
|
|
|
public class Vector2Variable : VariableBase<Vector2> |
|
|
|
{ |
|
|
|
{ |
|
|
|
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 }; |
|
|
|
|
|
|
|
|
|
|
|
public virtual bool Evaluate(CompareOperator compareOperator, Vector2 value) |
|
|
|
public virtual bool Evaluate(CompareOperator compareOperator, Vector2 value) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -44,6 +44,12 @@ 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; |
|
|
|
default: |
|
|
|
default: |
|
|
|
Debug.LogError("The " + setOperator.ToString() + " set operator is not valid."); |
|
|
|
Debug.LogError("The " + setOperator.ToString() + " set operator is not valid."); |
|
|
|
break; |
|
|
|
break; |
|
|
|