値以上の最も近い2 のべき乗を返します
// prints 8 Debug.Log(Mathf.NextPowerOfTwo(7)); // prints 256 Debug.Log(Mathf.NextPowerOfTwo(139));
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { Debug.Log(Mathf.NextPowerOfTwo(7)); Debug.Log(Mathf.NextPowerOfTwo(139)); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: Debug.Log(Mathf.NextPowerOfTwo(7)) Debug.Log(Mathf.NextPowerOfTwo(139))