#unity/日常积累

public static float Max (float a, float b);

public static float Max (params float[] values);

描述

返回两个或更多值中的最大值。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
using UnityEngine;

public class ScriptExample : MonoBehaviour
{
    void Start()
    {
        // prints 2.4
        Debug.Log(Mathf.Max(1.2f, 2.4f));
    }
}