Enhance tile emission effects and integrate beat synchronization
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user