sum fixes
This commit is contained in:
20
Scripts/BasicEnemy.cs
Normal file
20
Scripts/BasicEnemy.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
|
||||
public partial class BasicEnemy : Node3D
|
||||
{
|
||||
protected GameManager _gameManager;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
|
||||
}
|
||||
|
||||
public void OnEnemyHit(Node3D node)
|
||||
{
|
||||
QueueFree();
|
||||
if (_gameManager.CheckAllEnemiesDefeated())
|
||||
{
|
||||
_gameManager.OnAllEnemiesDefeated();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user