|
|
|
@ -21,7 +21,8 @@ namespace Fungus
|
|
|
|
|
typeof(ColorVariable), |
|
|
|
|
typeof(GameObjectVariable), |
|
|
|
|
typeof(MaterialVariable), |
|
|
|
|
typeof(ObjectVariable))] |
|
|
|
|
typeof(ObjectVariable), |
|
|
|
|
typeof(Rigidbody2DVariable))] |
|
|
|
|
[SerializeField] protected Variable variable; |
|
|
|
|
|
|
|
|
|
[Tooltip("Boolean value to compare against")] |
|
|
|
@ -54,6 +55,9 @@ namespace Fungus
|
|
|
|
|
[Tooltip("Object value to compare against")] |
|
|
|
|
[SerializeField] protected ObjectData objectData; |
|
|
|
|
|
|
|
|
|
[Tooltip("Rigidbody2D value to compare against")] |
|
|
|
|
[SerializeField] protected Rigidbody2DData rigidbody2DData; |
|
|
|
|
|
|
|
|
|
protected override bool EvaluateCondition() |
|
|
|
|
{ |
|
|
|
|
if (variable == null) |
|
|
|
@ -113,6 +117,11 @@ namespace Fungus
|
|
|
|
|
ObjectVariable objectVariable = (variable as ObjectVariable); |
|
|
|
|
condition = objectVariable.Evaluate(compareOperator, objectData.Value); |
|
|
|
|
} |
|
|
|
|
else if (variable.GetType() == typeof(Rigidbody2DVariable)) |
|
|
|
|
{ |
|
|
|
|
Rigidbody2DVariable rigidbody2DVariable = (variable as Rigidbody2DVariable); |
|
|
|
|
condition = rigidbody2DVariable.Evaluate(compareOperator, rigidbody2DData.Value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return condition; |
|
|
|
|
} |
|
|
|
@ -134,7 +143,8 @@ namespace Fungus
|
|
|
|
|
{ typeof(ColorVariable), ColorVariable.compareOperators }, |
|
|
|
|
{ typeof(GameObjectVariable), GameObjectVariable.compareOperators }, |
|
|
|
|
{ typeof(MaterialVariable), MaterialVariable.compareOperators }, |
|
|
|
|
{ typeof(ObjectVariable), ObjectVariable.compareOperators } |
|
|
|
|
{ typeof(ObjectVariable), ObjectVariable.compareOperators }, |
|
|
|
|
{ typeof(Rigidbody2DVariable), Rigidbody2DVariable.compareOperators } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
@ -192,6 +202,10 @@ namespace Fungus
|
|
|
|
|
{ |
|
|
|
|
summary += objectData.GetDescription(); |
|
|
|
|
} |
|
|
|
|
else if (variable.GetType() == typeof(Rigidbody2DVariable)) |
|
|
|
|
{ |
|
|
|
|
summary += rigidbody2DData.GetDescription(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return summary; |
|
|
|
|
} |
|
|
|
|