Returns the closest power of two value.
// prints 8Debug.Log(Mathf.ClosestPowerOfTwo(7));// prints 16Debug.Log(Mathf.ClosestPowerOfTwo(19));
using UnityEngine;using System.Collections;public class example : MonoBehaviour { void Example() { Debug.Log(Mathf.ClosestPowerOfTwo(7)); Debug.Log(Mathf.ClosestPowerOfTwo(19)); }}
import UnityEngineimport System.Collectionsclass example(MonoBehaviour): def Example(): Debug.Log(Mathf.ClosestPowerOfTwo(7)) Debug.Log(Mathf.ClosestPowerOfTwo(19))