기술 자료

Unity Engine

Download Unity

Unity Engine

IsPowerOfTwo(int)

Returns true if the value is power of two.
읽는 시간 1분최근 업데이트: 13시간 전

Definition

public static bool IsPowerOfTwo(int value)

Parameters

value

Returns

Type

Description

bool

Examples

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