Unlockable door implementation (currently opens with regular attack)

This commit is contained in:
2026-01-21 00:50:21 -08:00
parent aa9e14c498
commit 9897acffac
4 changed files with 59 additions and 8 deletions

View File

@@ -1,6 +1,23 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
[Meta(typeof(IAutoNode))]
public partial class UnlockableDoor : Node3D, IDoor
{
public override void _Notification(int what) => this.Notify(what);
[Node] public Area3D UnlockArea { get; set; }
public void OnReady()
{
UnlockArea.AreaEntered += UnlockArea_AreaEntered;
}
private void UnlockArea_AreaEntered(Area3D area)
{
var children = GetChildren();
foreach (var child in children)
child.QueueFree();
}
}