Mathf.Abs 绝对值
返回指定参数 f 绝对值
Debug.Log(Mathf.Abs(-3)); // Prints 3
Mathf.Approximately 近似
如果a和b相似,则返回true。
if (Mathf.Approximately(1.0f, 10.0f / 10.0f)) //sometimes return true;
Mathf.Ceil 向上取整
Debug.Log(Mathf.Ceil(10.0F)); // Prints 10
Debug.Log(Mathf.Ceil(10.2F)); // Prints 11
Debug.Log(Mathf.Ceil(10.7F)); // Prints 11
Debug.Log(Mathf.Ceil(-10.0F)); // Prints -10
Debug.Log(Mathf.Ceil(-10.2F)); // Prints -10
Debug.Log(Mathf.Ceil(-10.7F)); // Prints -10
Mathf.Floor 向下取整
Debug.Log(Mathf.Floor(10.0F)); // Prints 10
Debug.Log(Mathf.Floor(10.2F)); // Prints 10
Debug.Log(Mathf