mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
32 lines
No EOL
784 B
C#
32 lines
No EOL
784 B
C#
using Godot;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Cirno.Scripts;
|
|
using Cirno.Scripts.Resources;
|
|
using Godot.Collections;
|
|
|
|
public partial class Pickupper : Activable
|
|
{
|
|
private InventoryManager _inventoryManager;
|
|
|
|
[Export] public Array<LootItem> LootTable = new Array<LootItem>();
|
|
|
|
public override void _Ready()
|
|
{
|
|
_inventoryManager = GetNode<InventoryManager>("/root/GameScene/InventoryManager");
|
|
}
|
|
|
|
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
|
|
{
|
|
foreach (var item in LootTable)
|
|
{
|
|
_inventoryManager.AddItem(item);
|
|
}
|
|
|
|
//inventoryManager.AddRedKeycard();
|
|
//GetParent().QueueFree(); // TODO: send a signal instead
|
|
|
|
|
|
return true;
|
|
}
|
|
} |