鸟语天空
Mathf.ClosestPowerOfTwo()
post by:追风剑情 2017-7-27 14:32

返回最接近的2的指数次方的值

示例一

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        Debug.Log(Mathf.ClosestPowerOfTwo(7));
        Debug.Log(Mathf.ClosestPowerOfTwo(19));
    }
}

运行

1111.png

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容