connect multiple rooms with doors

This commit is contained in:
2022-11-03 21:20:00 +01:00
parent bce88d0504
commit 807eae1c62
24 changed files with 391 additions and 88 deletions

View File

@@ -0,0 +1,23 @@
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.
/// </summary>
/// <param name="position">The position to check, relative to the dimensions.</param>
/// <param name="dimensions">The dimensions to check the position against.</param>
public static bool IsInsideRelative(this Vector2Int position, Dimensions dimensions)
{
return position.x >= 0 && position.y >= 0 && position.x < dimensions.width && position.y < dimensions.length;
}
#endregion
}
}