Mathf.ClosestPowerOfTwo()

作者:追风剑情 发布于:2017-7-27 14:32 分类:Unity3d

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

示例一

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ExampleClass : MonoBehaviour {
  5. void Example() {
  6. Debug.Log(Mathf.ClosestPowerOfTwo(7));
  7. Debug.Log(Mathf.ClosestPowerOfTwo(19));
  8. }
  9. }

运行

1111.png

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号