18 lines
536 B
C#
18 lines
536 B
C#
using UnityEngine;
|
|
|
|
namespace Utils {
|
|
public static class Vector2IntUtils {
|
|
public static bool Compare(this Vector2Int a, Vector2 b) {
|
|
Vector2 aVector2 = new Vector2(a.x, a.y);
|
|
return Vector2.Distance(aVector2, b) < 0.01f;
|
|
}
|
|
|
|
public static Vector2 ToVector2(this Vector2Int v) {
|
|
return new Vector2(v.x, v.y);
|
|
}
|
|
|
|
public static Vector2Int ToVector2Int(this Vector2 v) {
|
|
return new Vector2Int((int)v.x, (int)v.y);
|
|
}
|
|
}
|
|
} |