using System; using UnityEngine; public static class GameplayLevelRuleEventBus { public static event Action TapJudged; public static event Action HoldStarted; public static event Action HoldCompleted; public static event Action HoldBroken; public static event Action AllySkillCast; public static event Action EnemySpawned; public static event Action EnemyDied; public static event Action EnemyDamaged; public static event Action EnemyManaFull; public static void NotifyTapJudged(int trackIndex, string result, float songTime, NoteData noteData) { TapJudged?.Invoke(trackIndex, result, songTime, noteData); } public static void NotifyHoldStarted(int trackIndex, string result, float songTime, NoteData noteData) { HoldStarted?.Invoke(trackIndex, result, songTime, noteData); } public static void NotifyHoldCompleted(int trackIndex, string result, float songTime, NoteData noteData) { HoldCompleted?.Invoke(trackIndex, result, songTime, noteData); } public static void NotifyHoldBroken(int trackIndex, string result, float songTime, NoteData noteData) { HoldBroken?.Invoke(trackIndex, result, songTime, noteData); } public static void NotifyAllySkillCast(int slotIndex, float songTime) { AllySkillCast?.Invoke(slotIndex, songTime); } public static void NotifyEnemySpawned(EnemyCombatant enemy, int stageIndex, EnemyData_SO data) { EnemySpawned?.Invoke(enemy, stageIndex, data); } public static void NotifyEnemyDied(EnemyCombatant enemy, int stageIndex, EnemyData_SO data) { EnemyDied?.Invoke(enemy, stageIndex, data); } public static void NotifyEnemyDamaged(EnemyCombatant enemy, float actualDamage, GameObject source) { EnemyDamaged?.Invoke(enemy, actualDamage, source); } public static void NotifyEnemyManaFull(EnemyCombatant enemy) { EnemyManaFull?.Invoke(enemy); } public static bool ShouldPreventEnemyDeath(EnemyCombatant enemy) { return LevelRuleController.Instance != null && LevelRuleController.Instance.ShouldPreventEnemyDeath(enemy); } }