Unlockable door implementation (currently opens with regular attack)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user