기술 자료

Unity Engine

Unity Engine

ClosestPowerOfTwo(int)

Returns the closest power of two value.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static int ClosestPowerOfTwo(int value)

Parameters

value

Returns

Type

Description

int

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { // prints 8 Debug.Log(Mathf.ClosestPowerOfTwo(7)); // prints 16 Debug.Log(Mathf.ClosestPowerOfTwo(19)); }}