Mathf.NextPowerOfTwo
Declaration
public static int NextPowerOfTwo(int value);Описание
Возвращает следующую степень двойки, которая равна или больше, чем аргумент.
using UnityEngine;
public class ExampleClass : MonoBehaviour { void Start() { //Prints 8 to the console Debug.Log(Mathf.NextPowerOfTwo(7));
//Prints 256 to the console Debug.Log(Mathf.NextPowerOfTwo(139));
//Prints 256 to the console Debug.Log(Mathf.NextPowerOfTwo(256)); } }