Returns the smallest of two or more values.
using UnityEngine;
public class ScriptExample : MonoBehaviour { void Start() { // Prints 0 Debug.Log(Mathf.Min(0, Mathf.Infinity)); // Prints -Infinity Debug.Log(Mathf.Min(0, -Mathf.Infinity)); // Prints -Infinity Debug.Log(Mathf.Min(-Mathf.Infinity, Mathf.Infinity)); // Prints -1 Debug.Log(Mathf.Min(0, 1, 5, -1, 8, 10)); } }
Returns the smallest of two or more values.
using UnityEngine;
public class ScriptExample : MonoBehaviour { void Start() { // prints 1 Debug.Log(Mathf.Min(1, 2)); } }