Enhance tile emission effects and integrate beat synchronization

This commit is contained in:
2025-12-13 00:58:49 +01:00
parent cd28adc8e9
commit 53de85a269
5 changed files with 28 additions and 8 deletions

View File

@@ -56,6 +56,7 @@ namespace Infrastructure.Unity
private void OnDisable()
{
_actions.Player.Disable();
beatPulseController.OnMeasure.RemoveListener(OnBeatMeasure);
}
@@ -206,6 +207,11 @@ namespace Infrastructure.Unity
_gameSession.OnSpawnNpc += SpawnNpc;
_gameSession.OnSpawnPowerUp += SpawnPowerUp;
if (beatPulseController)
{
beatPulseController.OnMeasure.AddListener(OnBeatMeasure);
}
if (!soundManager) return;
_gameSession.OnScoreChanged += _ => soundManager.PlayScore();
@@ -291,5 +297,16 @@ namespace Infrastructure.Unity
}
};
}
private void OnBeatMeasure()
{
foreach (var tile in _allTiles)
{
if (!_tileViews.TryGetValue(tile.Id, out var tileView)) continue;
if (tile.CurrentState != TileState.Stable) continue;
tileView.PulseEmission(1.3f);
}
}
}
}