Add SkillManager class and integrate with PlayerController and SkillUnlockerComponent (#10)

This commit is contained in:
2025-08-31 13:04:50 +02:00
committed by GitHub
parent 2d520a708f
commit bd40c797d4
11 changed files with 116 additions and 32 deletions

View File

@@ -58,6 +58,10 @@ public partial class GameManager : Node
private void OnNodeRemoved(Node node)
{
_sceneNodes.Remove(node);
if (node == _player)
{
_player = null;
}
}
public void AddCoins(int amount)
@@ -231,7 +235,9 @@ public partial class GameManager : Node
public PlayerController GetPlayer()
{
if (_player != null) return _player;
if (_player != null && IsInstanceValid(_player)) return _player;
_player = null;
foreach (var node in _sceneNodes)
{