Mathf
- Abs
- Acos
- Approximately
- Asin
- Atan2
- Atan
- CeilToInt
- Ceil
- Clamp01
- Clamp
- ClosestPowerOfTwo
- Cos
- Deg2Rad
- DeltaAngle
- Epsilon
- Exp
- FloorToInt
- Floor
- Infinity
- InverseLerp
- IsPowerOfTwo
- LerpAngle
- Lerp
- Log10
- Log
- Max
- Min
- MoveTowardsAngle
- MoveTowards
- NegativeInfinity
- NextPowerOfTwo
- PingPong
- PI
- Pow
- Rad2Deg
- Repeat
- RoundToInt
- Round
- Sign
- Sin
- SmoothDampAngle
- SmoothDamp
- SmoothStep
- Sqrt
- Tan
Mathf.NextPowerOfTwo 下个2的幂
static function NextPowerOfTwo (value : int) : int
Description描述
Returns the next power of two value
返回下一个2的幂值。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Awake() {
Debug.Log(Mathf.NextPowerOfTwo(7));
Debug.Log(Mathf.NextPowerOfTwo(139));
}
}
最后修改:2011年4月16日 Saturday 17:36