Version: 2022.3
言語: 日本語
public static bool IsPowerOfTwo (int value);

説明

値が 2 のべき乗のときに、true を返す。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { // prints false Debug.Log(Mathf.IsPowerOfTwo(7));

// prints true Debug.Log(Mathf.IsPowerOfTwo(32)); } }