namespace AtlasUtility { using UnityEngine; public static class ExMath { public static int PrevPOT(float value) { int result = Mathf.ClosestPowerOfTwo(Mathf.CeilToInt(value)); if (result > value) { return result/2; } else { return result; } } public static int NextPOT(float value) { int result = Mathf.ClosestPowerOfTwo(Mathf.CeilToInt(value)); if (result >= value) { return result; } else { return result*2; } } } }