connect multiple rooms with doors
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Modules
|
||||
{
|
||||
public enum DoorType
|
||||
{
|
||||
Entrance = ModuleType.DoorEntrance, Exit = ModuleType.DoorExit
|
||||
}
|
||||
|
||||
public class DoorModule : Module
|
||||
{
|
||||
public bool IsEntrance => IsType((ModuleType)DoorType.Entrance);
|
||||
public bool IsExit => IsType((ModuleType)DoorType.Exit);
|
||||
|
||||
internal DoorModule(DoorType type, Space space) : base(space)
|
||||
{
|
||||
types.Add((ModuleType)type);
|
||||
srDimensions.Size = Vector2Int.one; // door always has size 1x1
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{(IsEntrance ? "Entrance" : IsExit ? "Exit" : "Unknown")} door";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user