using UnityEngine; using System.Collections; using System.Collections.Generic; 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; } } }