using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; namespace MoreMountains.Tools { /// /// Float extensions /// public static class MMFloatExtensions { /// /// Normalizes an angle in degrees /// /// /// public static float MMNormalizeAngle(this float angleInDegrees) { angleInDegrees = angleInDegrees % 360f; if (angleInDegrees < 0) { angleInDegrees += 360f; } return angleInDegrees; } /// /// Rounds a float down /// /// /// /// public static float RoundDown(this float number, int decimalPlaces) { return Mathf.Floor(number * Mathf.Pow(10, decimalPlaces)) / Mathf.Pow(10, decimalPlaces); } } }