mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:45:33 +00:00
Keycards
This commit is contained in:
parent
14893a544b
commit
ba46799911
7 changed files with 60 additions and 6 deletions
|
|
@ -5,9 +5,24 @@ using System.Diagnostics;
|
|||
public partial class Interactable : Area2D
|
||||
{
|
||||
[Export] public Activable Target { get; set; }
|
||||
[Export] public bool RequiresKeycard { get; set; }
|
||||
private InventoryManager _inventoryManager;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_inventoryManager = GetNode<InventoryManager>("/root/GameScene/InventoryManager");
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
Target?.Activate();
|
||||
if (RequiresKeycard) {
|
||||
if (_inventoryManager.RedKeycard) {
|
||||
Target?.Activate();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Target?.Activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue