This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// [范围限定] 将数字限定在 最小 ~ 最大之间 | |
/// </summary> | |
/// <param name="value">限定数字</param> | |
/// <param name="min">最小值</param> | |
/// <param name="max">最大值</param> | |
/// <returns>限定后结果</returns> | |
public static int Clamp(int value, int min, int max) | |
{ | |
if (max < min) return value; |