split into multiple assemblies

This commit is contained in:
2022-11-20 12:52:22 +01:00
parent def03954a0
commit 9fdfafc3eb
373 changed files with 380 additions and 119 deletions

View File

@@ -0,0 +1,48 @@
using EscapeRoomEngine.Engine.Runtime.Modules;
using UnityEngine;
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
namespace EscapeRoomEngine.Engine.Runtime
{
public class Passage
{
internal DoorModule fromOut, toIn;
/// <summary>
/// The room relative (<i>RR</i>) position of this passage.
/// </summary>
internal Vector2Int rrPosition;
internal Passage(DoorModule from, bool spawnPassage = false)
{
if (spawnPassage)
{
fromOut = from;
rrPosition = Vector2Int.zero;
}
else
{
ConnectFrom(from);
}
}
internal void ConnectFrom(DoorModule door)
{
fromOut = door;
rrPosition = fromOut.RrPosition;
Logger.Log($"Connected passage from {door} at {rrPosition} (RR)", LogType.PassageConnection);
}
internal void ConnectTo(DoorModule door)
{
toIn = door;
// to make sure the origin of the player doesn't move, the two doors must be placed in the same location in the same orientation
toIn.PlaceRoomRelative(rrPosition);
toIn.orientation = fromOut.orientation;
Logger.Log($"Connected passage to {door} at {rrPosition} (RR)", LogType.PassageConnection);
}
}
}