mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-04 14:35:54 +00:00
28 lines
536 B
C#
28 lines
536 B
C#
using Godot;
|
|
using System;
|
|
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()
|
|
{
|
|
if (RequiresKeycard) {
|
|
if (_inventoryManager.RedKeycard) {
|
|
Target?.Activate();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Target?.Activate();
|
|
}
|
|
}
|
|
}
|