MathHelper.cs 744 B

12345678910111213141516171819202122232425262728293031323334
  1. using UnityEngine;
  2. namespace Pathfinding
  3. {
  4. public static class MathHelper
  5. {
  6. public static Vector3 ToUnityV3(this Vector3 v3)
  7. {
  8. return new Vector3(v3.x, v3.y, v3.z);
  9. }
  10. public static Vector3 ToPFV3(this Vector3 v3)
  11. {
  12. return new Vector3(v3.x, v3.y, v3.z);
  13. }
  14. public static Vector2 ToV2(this Vector3 v3)
  15. {
  16. return new Vector2(v3.x, v3.y);
  17. }
  18. public static Vector2 ToUnityV2(this Vector2 v2)
  19. {
  20. return new Vector3(v2.x, v2.y);
  21. }
  22. public static Vector2 ToPFV2(this Vector2 v2)
  23. {
  24. return new Vector2(v2.x, v2.y);
  25. }
  26. }
  27. }