generic doors

This commit is contained in:
2022-11-04 09:46:00 +01:00
parent 807eae1c62
commit ba4fa9430c
37 changed files with 1071 additions and 77 deletions

View File

@@ -1,12 +1,11 @@
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
namespace Escape_Room_Engine.Engine.Scripts.Utilities
{
public static class Utilities
{
#region Math
public static int RandomInclusive(int from, int to) => Random.Range(from, to + 1);
/// <summary>
/// Returns whether a position relative to some dimensions is inside those dimensions.
@@ -19,5 +18,13 @@ namespace Escape_Room_Engine.Engine.Scripts.Utilities
}
#endregion
#region Randomness
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)];
#endregion
}
}