snap to grid

This commit is contained in:
klemek
2020-12-11 17:15:37 +01:00
parent 4bc26a2439
commit e43a0c6de0
6 changed files with 103 additions and 8 deletions
+5
View File
@@ -51,5 +51,10 @@ namespace UntitledLogicGame
{
return array.Select((v, i) => (v ? 1 : 0) << (array.Length - i - 1)).Sum();
}
public static Vector3 Round(this Vector3 v)
{
return new Vector3(Mathf.Round(v.x), Mathf.Round(v.y), Mathf.Round(v.z));
}
}
}