puzzle flow
This commit is contained in:
@@ -17,9 +17,11 @@ namespace Escape_Room_Engine.Engine.Scripts
|
||||
internal List<Module> Modules { get; } = new(2);
|
||||
|
||||
private GameObject _spaceObject;
|
||||
private readonly Room _room;
|
||||
|
||||
internal Space(Passage entrance)
|
||||
internal Space(Room room, Passage entrance)
|
||||
{
|
||||
_room = room;
|
||||
rrDimensions = GenerateSpaceDimensions(
|
||||
entrance,
|
||||
Engine.DefaultEngine.config.minRoomSize,
|
||||
@@ -34,6 +36,11 @@ namespace Escape_Room_Engine.Engine.Scripts
|
||||
internal void AddModule(Module module)
|
||||
{
|
||||
Modules.Add(module);
|
||||
|
||||
if (module is PuzzleModule puzzleModule)
|
||||
{
|
||||
_room.AddPuzzle(puzzleModule);
|
||||
}
|
||||
}
|
||||
|
||||
internal bool AddModuleWithRequirements(Module module)
|
||||
@@ -95,11 +102,6 @@ namespace Escape_Room_Engine.Engine.Scripts
|
||||
/// <param name="rrPosition">The room relative (<i>RR</i>) position that should be converted to a space relative (<i>SR</i>) position.</param>
|
||||
internal Vector2Int ToSpaceRelative(Vector2Int rrPosition) => rrPosition - rrDimensions.Position;
|
||||
|
||||
internal void Destroy()
|
||||
{
|
||||
Object.Destroy(_spaceObject);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate space dimensions that fit the required size constraints and cover the position of the entrance.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user