requirements foundation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Utilities
|
||||
@@ -24,6 +25,7 @@ namespace Escape_Room_Engine.Engine.Scripts.Utilities
|
||||
public static int RandomInclusive(int from, int to) => Random.Range(from, to + 1);
|
||||
|
||||
public static T RandomElement<T>(this List<T> list) => list[Random.Range(0, list.Count)];
|
||||
public static T RandomElement<T>(this HashSet<T> set) => set.ElementAt(Random.Range(0, set.Count));
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user