Files
modular-vr/Assets/Engine/Runtime/Passage.cs

27 lines
899 B
C#

using EscapeRoomEngine.Engine.Runtime.Modules;
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
namespace EscapeRoomEngine.Engine.Runtime
{
public class Passage
{
internal readonly DoorModule fromOut;
internal DoorModule toIn;
internal Passage(DoorModule from)
{
fromOut = from;
}
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(fromOut.RrPosition, fromOut.Orientation);
Logger.Log($"Connected passage from {fromOut} to {toIn} at {toIn.RrPosition} (RR)", LogType.PassageConnection);
}
}
}