Create local EventManager wrapper to expose ConfigurableEventManager as GlobalClass
This commit is contained in:
@@ -10,13 +10,13 @@ namespace Voider;
|
||||
public partial class EventExample : Node
|
||||
{
|
||||
// Reference to the ConfigurableEventManager in the scene
|
||||
private ConfigurableEventManager _eventManager;
|
||||
private EventManager _eventManager;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
// Get reference to the ConfigurableEventManager node
|
||||
// (Assumes it's named "EventManager" in your scene tree)
|
||||
_eventManager = GetNode<ConfigurableEventManager>("/root/Main/EventManager");
|
||||
_eventManager = GetNode<EventManager>("/root/Main/EventManager");
|
||||
|
||||
// Subscribe to events
|
||||
SubscribeToEvents();
|
||||
|
||||
15
Scripts/EventManager.cs
Normal file
15
Scripts/EventManager.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Godot;
|
||||
using EinSoftworks.Events;
|
||||
|
||||
namespace Voider;
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper for ConfigurableEventManager that makes it available in this project.
|
||||
/// This inherits from the library's ConfigurableEventManager.
|
||||
/// </summary>
|
||||
[GlobalClass]
|
||||
public partial class EventManager : ConfigurableEventManager
|
||||
{
|
||||
// Inherits all functionality from ConfigurableEventManager
|
||||
// You can add project-specific event manager functionality here if needed
|
||||
}
|
||||
1
Scripts/EventManager.cs.uid
Normal file
1
Scripts/EventManager.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://butot2dkursrs
|
||||
Reference in New Issue
Block a user