Files
TEngine/UnityProject/Packages/com.code-philosophy.obfuz/Editor/Utils/RandomUtil.cs
2025-07-26 08:10:41 +08:00

20 lines
448 B
C#

using System.Collections.Generic;
namespace Obfuz.Utils
{
static class RandomUtil
{
public static void ShuffleList<T>(List<T> list, IRandom random)
{
int n = list.Count;
for (int i = n - 1; i > 0; i--)
{
int j = random.NextInt(i + 1);
T temp = list[i];
list[i] = list[j];
list[j] = temp;
}
}
}
}