Files
GameJamDungeon/src/item_rescue/ItemRescue.cs
Zenny b733a30724 Fix thrown item position
Start adding more floors
Testing Item Rescue
2025-03-04 00:32:24 -08:00

27 lines
579 B
C#

using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using GameJamDungeon;
using Godot;
namespace GameJamDungeon;
[Meta(typeof(IAutoNode))]
public partial class ItemRescue : Area3D
{
public override void _Notification(int what) => this.Notify(what);
public void Initialize()
{
BodyEntered += OnItemRescueEntered;
}
public void OnItemRescueEntered(Node3D item)
{
GD.Print("Item rescue entered");
if (item is IDroppedItem droppedItem)
droppedItem.RescueItem();
if (item is ThrownItem thrownItem)
thrownItem.RescueItem();
}
}