SFX
This commit is contained in:
24
Scenes/Levels/Level3.cs
Normal file
24
Scenes/Levels/Level3.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Level3 : Node3D
|
||||
{
|
||||
private int _numberOfHits = 3;
|
||||
private MeshInstance3D _door;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_door = GetNode<MeshInstance3D>("Door");
|
||||
}
|
||||
|
||||
private void OnDoorHit(Node3D node)
|
||||
{
|
||||
_numberOfHits--;
|
||||
GD.Print(_numberOfHits);
|
||||
if (_numberOfHits == 0)
|
||||
{
|
||||
_door.Hide();
|
||||
_door.QueueFree();
|
||||
_door = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user