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.Abs 绝对值
static function Abs (f : float) : float
Description描述
Returns the absolute value of f.
计算并返回指定参数 f 绝对值。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
print(Mathf.Abs(-10.5F));
}
}
// prints 10.5
print(Mathf.Abs(-10.5));
•static function Abs (value : int) : int
Description描述
Returns the absolute value of value.
计算并返回指定参数value绝对值。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
print(Mathf.Abs(-10));
}
}
// prints 10
print(Mathf.Abs(-10));
最后修改:2011年2月22日 Tuesday 19:03