private int CompareInteractableDistances(IInteractable i1, IInteractable i2) { if ((i1 is MonoBehaviour == false) || (i2 is MonoBehaviour == false)) { return(0); } Transform t1 = ((MonoBehaviour)i1).transform; Transform t2 = ((MonoBehaviour)i2).transform; return(VectorUtil.CompareDistanceToTarget2D(t1.position, t2.position, transform.position)); }
public void CompareDistanceToTarget2D_DistanceSmaller(float x1, float y1, float x2, float y2, float tarX, float tarY) { int result = VectorUtil.CompareDistanceToTarget2D(new Vector2(x1, y1), new Vector2(x2, y2), new Vector2(tarX, tarY)); NUnit.Framework.Assert.IsTrue(result < 0); }