23/11/25 11:28:32.02 6mVYgNka.net
1
public static int Range(int minInclusive, int maxExclusive);
なのでint型はmin以上max以下だから1~3が欲しいならRandom.Range(1, 4)
ただしfloat型の場合
public static float Range(float minInclusive, float maxInclusive);
なのでmin以上max未満だから1.0f~3.0fが欲しいならRandom.Range(1.0f, 3.0f)
2
特定の数値をList<int>にぶち込んでこれ呼び出せばランダムな値取ってきてくれる↓
public static T RandomPick<T>(IReadOnlyList<T> collection)
{
return collection[UnityEngine.Random.Range(0, collection.Count)];
}