Forest_Client/Forest/Assets/PhxhSDK/Phxh/Utils/Utils.Enum.cs

15 lines
336 B
C#

using UnityEngine;
namespace PhxhSDK
{
public partial class Utils
{
public static T GetRandomEnum<T>() where T : System.Enum
{
T[] values = (T[])System.Enum.GetValues(typeof(T));
int randomIndex = Random.Range(0, values.Length);
return values[randomIndex];
}
}
}