Version: 2018.2
public static float Abs (float f);

説明

/f/の絶対値を返す。

using UnityEngine;

public class ScriptExample : MonoBehaviour { void Start() { // prints 10.5 Debug.Log(Mathf.Abs(-10.5f)); } }

public static int Abs (int value);

説明

/value/の絶対値を返す。

using UnityEngine;

public class MathAbsExample : MonoBehaviour { void Start() { // prints 10 Debug.Log(Mathf.Abs(-10)); } }