📅  最后修改于: 2022-03-11 14:55:54.257000             🧑  作者: Mango
List usedValues = new List();
public int UniqueRandomInt(int min, int max)
{
int val = Random.Range(min, max);
while(usedValues.Contains(val))
{
val = Random.Range(min, max);
}
return val;
}