Mathf.Abs绝对值

  计算并返回指定参数 f 绝对值。

  Mathf.Acos反余弦

  static function Acos (f : float) : float

  以弧度为单位计算并返回参数 f 中指定的数字的反余弦值。

  Mathf.Approximately近似

  static function Approximately (a : float, b: float) : bool

  比较两个浮点数值,看它们是否非常接近, 由于浮点数值不精确,不建议使用等于来比较它们。例如,1.0==10.0/10.0也许不会返回true。

  
1 public class example : MonoBehaviour 
2 {
3             public void Awake() 
4             {
5                         if(Mathf.Approximately(1.0F, 10.0F / 10.0F))
6                                     print("same");
7             }
8 }    
View Code

相关文章:

  • 2022-12-23
  • 2021-11-06
  • 2021-05-02
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案