Объявление
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));
}
}