Cleanup GameBOardService
This commit is contained in:
@@ -14,5 +14,10 @@ namespace Utils {
|
||||
public static Vector2Int ToVector2Int(this Vector2 v) {
|
||||
return new Vector2Int((int)v.x, (int)v.y);
|
||||
}
|
||||
|
||||
public static bool IsAdjacent(this Vector2Int a, Vector2Int b) {
|
||||
Vector2Int d = b - a;
|
||||
return (Mathf.Abs(d.x) == 1 && d.y == 0) || (Mathf.Abs(d.y) == 1 && d.x == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user