feat: Implement a comprehensive global event bus with new event handlers and integrate player health and collection events.

This commit is contained in:
2026-01-31 15:15:52 +01:00
parent dde3eaa52e
commit 62bdf1ba39
15 changed files with 322 additions and 54 deletions

View File

@@ -1,4 +1,5 @@
using Godot;
using Mr.BrickAdventures;
using Mr.BrickAdventures.Autoloads;
namespace Mr.BrickAdventures.scripts.Events;
@@ -10,10 +11,9 @@ public partial class SpeedRunEventHandler : Node
public override void _Ready()
{
_speedRunManager = GetNode<SpeedRunManager>("/root/SpeedRunManager");
var eventBus = GetNode<EventBus>("/root/EventBus");
eventBus.LevelCompleted += OnLevelCompleted;
_speedRunManager = GetNode<SpeedRunManager>(Constants.SpeedRunManagerPath);
EventBus.Instance.LevelCompleted += OnLevelCompleted;
}
private void OnLevelCompleted(int levelIndex, Node currentScene, double completionTime)