public static void AssertEquals(this Vector3 unityVector3, UnEngine.Vector3 unVector3, string identifier = "") { if (!unityVector3.DoesEqual(unVector3)) { throw new AssertException(string.Format("{2} unity vector3 not equal to unengine vector3! unity: {0} unegine: {1}", unityVector3, unVector3, identifier)); } }
static void Properties() { for (int i = 0; i < PropertyTestCount; i++) { var x = Random.Range(float.MinValue, float.MaxValue); var y = Random.Range(float.MinValue, float.MaxValue); var z = Random.Range(float.MinValue, float.MaxValue); var expected = new Vector3(x, y, z); var actual = new UnEngine.Vector3(x, y, z); expected.AssertEquals(actual); } Debug.Log("Completed Vector3 Properties test"); }
public static bool DoesEqual(this Vector3 unityVector3, UnEngine.Vector3 unVector3) { //TODO: better comparison. Do we want some fudge room, or should they be identical? return(unityVector3.x == unVector3.x && unityVector3.y == unVector3.y && unityVector3.z == unVector3.z); }
public static Vector3 ToUnity(this UnEngine.Vector3 v) { return(new Vector3(v.x, v.y, v.z)); }