返回大于或等于参数的下一个 2 的幂。
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)); } }