ProjectZ/Assets/Scripts/Extensions.cs

15 lines
342 B
C#

using UnityEngine;
namespace Koptilnya
{
public static class Extensions
{
public static float ClampAngle(this float value, float min, float max)
{
if (value < -360f) value += 360f;
if (value > 360f) value -= 360f;
return Mathf.Clamp(value, min, max);
}
}
}