Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public static class MathUtility
  4. {
  5.     public static float ClampAngle(float angle, float min, float max)
  6.     {
  7.         if (angle < -360)
  8.             angle += 360;
  9.         if (angle > 360)
  10.             angle -= 360;
  11.         return Mathf.Clamp(angle, min, max);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement