17 lines
461 B
C#
17 lines
461 B
C#
using System;
|
|
using System.Linq;
|
|
using Enums;
|
|
using Random = UnityEngine.Random;
|
|
|
|
namespace Utils {
|
|
public static class RandomUtils {
|
|
public static int RandomGemTypeAsInt() {
|
|
GemType[] spawnableGems = Enum.GetValues(typeof(GemType))
|
|
.Cast<GemType>()
|
|
.Where(gType => gType != GemType.Bomb)
|
|
.ToArray();
|
|
|
|
return Random.Range(0, spawnableGems.Length);
|
|
}
|
|
}
|
|
} |