connect multiple rooms with doors
This commit is contained in:
23
Assets/Escape Room Engine/Engine/Scripts/SpawnPassage.cs
Normal file
23
Assets/Escape Room Engine/Engine/Scripts/SpawnPassage.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user