28 lines
561 B
C#
28 lines
561 B
C#
|
|
using Chickensoft.AutoInject;
|
|
using Chickensoft.Introspection;
|
|
using Godot;
|
|
|
|
[Meta(typeof(IAutoNode))]
|
|
public partial class Door : Node3D, IDoor
|
|
{
|
|
public override void _Notification(int what) => this.Notify(what);
|
|
|
|
[Node] public AnimationPlayer AnimationPlayer { get; set; }
|
|
|
|
public void OnReady()
|
|
{
|
|
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
|
|
}
|
|
|
|
private void AnimationPlayer_AnimationFinished(StringName animName)
|
|
{
|
|
QueueFree();
|
|
}
|
|
|
|
public void Demolish()
|
|
{
|
|
AnimationPlayer.Play("explode");
|
|
}
|
|
}
|