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 Escape_Room_Engine.Engine.Scripts.Modules;
using UnityEngine;
namespace Escape_Room_Engine.Engine.Scripts
{
/// <summary>
/// A SpawnPassage is a type of passage used solely for entering the very fist space. It always places the entrance door at (0, 0).
/// </summary>
public class SpawnPassage : Passage
{
internal SpawnPassage() {}
internal override void ConnectTo(DoorModule door)
{
// this door module does not really exist, but is required since a passage must include an entry
// it also defines, where the exit will be placed (in this case always at the play space origin)
fromOut = new DoorModule(DoorType.Exit, null);
fromOut.Place(new Vector2Int(0, 0));
base.ConnectTo(door);
}
}
}