21 lines
377 B
C#
21 lines
377 B
C#
|
|
using Godot;
|
|
|
|
public partial class Door : MeshInstance3D
|
|
{
|
|
[Export]
|
|
public AnimationPlayer AnimationPlayer { get; set; }
|
|
[Export]
|
|
private int _numberOfHits = 10;
|
|
|
|
private void OnDoorHit(Node3D node)
|
|
{
|
|
_numberOfHits--;
|
|
GD.Print(_numberOfHits);
|
|
AnimationPlayer.Play("HitFlash");
|
|
|
|
if (_numberOfHits == 0)
|
|
QueueFree();
|
|
}
|
|
}
|