Returns true if the value is power of two.
#pragma strict public class Example extends MonoBehaviour { function Start() { // prints false Debug.Log(Mathf.IsPowerOfTwo(7)); // prints true Debug.Log(Mathf.IsPowerOfTwo(32)); } }
using UnityEngine;
public class Example : MonoBehaviour { void Start() { // prints false Debug.Log(Mathf.IsPowerOfTwo(7));
// prints true Debug.Log(Mathf.IsPowerOfTwo(32)); } }