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