mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 21:05:54 +00:00
Keycards fix
This commit is contained in:
parent
2be069eab4
commit
91fcd73688
7 changed files with 46 additions and 16 deletions
|
|
@ -10,18 +10,24 @@ public partial class Interactable : Area2D
|
|||
{
|
||||
[Export] public Array<LootItem> Requirements = [];
|
||||
|
||||
protected InventoryManager _inventoryManager;
|
||||
//protected InventoryManager _inventoryManager;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_inventoryManager = this.GetInventoryManager();
|
||||
//_inventoryManager = this.GetInventoryManager();
|
||||
//CallDeferred(MethodName.DeferredInitReferences);
|
||||
}
|
||||
|
||||
// private void DeferredInitReferences()
|
||||
// {
|
||||
// _inventoryManager = InventoryManager.Instance;
|
||||
// }
|
||||
|
||||
protected bool MeetsRequirements()
|
||||
{
|
||||
if (Requirements.Any())
|
||||
{
|
||||
if (_inventoryManager.HasItems(Requirements.Select(x => x.ItemKey).ToList()))
|
||||
if (InventoryManager.Instance.HasItems(Requirements.Select(x => x.ItemKey).ToList()))
|
||||
{
|
||||
GD.Print($"Requirements for activation of {this.Name} successfully met: {string.Join(",", Requirements.Select(x => x.Item))} ");
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue