24 lines
507 B
C#
24 lines
507 B
C#
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();
|
|
}
|
|
}
|