module state game objects
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using LogType = Escape_Room_Engine.Engine.Scripts.Utilities.LogType;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Modules
|
||||
{
|
||||
@@ -14,19 +13,24 @@ namespace Escape_Room_Engine.Engine.Scripts.Modules
|
||||
{
|
||||
public bool IsEntrance => IsType((ModuleType)DoorType.Entrance);
|
||||
public bool IsExit => IsType((ModuleType)DoorType.Exit);
|
||||
|
||||
private bool _unlocked;
|
||||
internal new DoorState State { get; private set; }
|
||||
|
||||
internal DoorModule(Space space, DoorModuleDescription description) : base(space, description)
|
||||
{
|
||||
srDimensions.Size = Vector2Int.one; // door always has size 1x1
|
||||
}
|
||||
|
||||
internal void Unlock()
|
||||
internal override void InstantiateModule(Transform parent)
|
||||
{
|
||||
_unlocked = true;
|
||||
base.InstantiateModule(parent);
|
||||
|
||||
Utilities.Logger.Log($"{this} has been unlocked", LogType.PuzzleFlow);
|
||||
space.room.AddDoor(this);
|
||||
}
|
||||
|
||||
protected override void AddStateComponent()
|
||||
{
|
||||
State = moduleObject.AddComponent<DoorState>();
|
||||
State.SetModule(this);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
Reference in New Issue
Block a user