Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1.     public static Vector2 Round(this Vector2 vector2, int precision = 2)
  2.     {
  3.         vector2.x = (float)Math.Round(vector2.x, precision);
  4.         vector2.y = (float)Math.Round(vector2.y, precision);
  5.         return vector2;
  6.     }
  7.  
  8.     public static Vector3 Round(this Vector3 vector3, int precision = 2)
  9.     {
  10.         vector3.x = (float)Math.Round(vector3.x, precision);
  11.         vector3.y = (float)Math.Round(vector3.y, precision);
  12.         vector3.z = (float)Math.Round(vector3.z, precision);
  13.         return vector3;
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement