Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Vector2 Round(this Vector2 vector2, int precision = 2)
- {
- vector2.x = (float)Math.Round(vector2.x, precision);
- vector2.y = (float)Math.Round(vector2.y, precision);
- return vector2;
- }
- public static Vector3 Round(this Vector3 vector3, int precision = 2)
- {
- vector3.x = (float)Math.Round(vector3.x, precision);
- vector3.y = (float)Math.Round(vector3.y, precision);
- vector3.z = (float)Math.Round(vector3.z, precision);
- return vector3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement