refactor: enhance GameStateStore integration and improve skill management
This commit is contained in:
@@ -12,13 +12,11 @@ public partial class BrickShieldSkillComponent : SkillComponentBase
|
||||
[Export] public PackedScene ShieldScene { get; set; }
|
||||
|
||||
private Node2D _shieldInstance;
|
||||
private GameManager _gameManager;
|
||||
private SkillManager _skillManager;
|
||||
private HealthComponent _shieldHealth;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_gameManager = GameManager.Instance;
|
||||
_skillManager = SkillManager.Instance;
|
||||
}
|
||||
|
||||
@@ -55,9 +53,9 @@ public partial class BrickShieldSkillComponent : SkillComponentBase
|
||||
|
||||
private void OnShieldDestroyed()
|
||||
{
|
||||
if (_gameManager != null && Data != null && _skillManager != null)
|
||||
if (Data != null && _skillManager != null)
|
||||
{
|
||||
_gameManager.RemoveSkill(Data.Name);
|
||||
GameStateStore.Instance?.RemoveUnlockedSkill(Data.Name);
|
||||
_skillManager.RemoveSkill(Data.Name);
|
||||
}
|
||||
_shieldInstance = null;
|
||||
|
||||
Reference in New Issue
Block a user