Mathf.ClosestPowerOfTwostatic function ClosestPowerOfTwo (value : int) : intDescriptionReturns the closest power of two value.
JavaScripts
// prints 8
Debug.Log(Mathf.ClosestPowerOfTwo(7)); // prints 16 Debug.Log(Mathf.ClosestPowerOfTwo(19)); using UnityEngine;
using System.Collections; public class example : MonoBehaviour { void Awake() { Debug.Log(Mathf.ClosestPowerOfTwo(7)); Debug.Log(Mathf.ClosestPowerOfTwo(19)); } } import UnityEngine
import System.Collections class example(MonoBehaviour): def Awake(): Debug.Log(Mathf.ClosestPowerOfTwo(7)) Debug.Log(Mathf.ClosestPowerOfTwo(19)) |
