SignalBus

by wokidoo

14

🚦 SignalBus

Godot Engine Godot v4.3 Godot Asset Library

SignalBus is a Godot plugin that provides a centralized signal management system, making it easier to decouple signals from specific scripts and facilitating one-to-many or many-to-many communication between nodes.


✨ Features

Centralized Signal Management – Manage signals globally in one place.
Decoupled Architecture – Reduce dependencies between nodes and scripts.
Flexible Signal Handling – Emit and connect to signals across the entire project.
Supports One-to-Many & Many-to-Many Communication – Ideal for event-driven architectures.


🛠 When to Use SignalBus

Use SignalBus when:

  • You need to decouple signals from specific scripts or nodes.
  • Multiple nodes need to emit or listen to the same signal, e.g., event handling or game state updates.
  • You want a cleaner and scalable approach to signal management.

⚠️ Note: SignalBus does not replace Godot’s built-in signal system. For simple, node-specific signals, use the default signal mechanism.


📥 Installation

1️⃣ Open the Godot Asset Library from the Godot Editor.
2️⃣ Search for SignalBus and click Download.
3️⃣ Enable the plugin via Project Settings > Plugins.

Option 2: Manual Installation

1️⃣ Download or Clone the repository.
2️⃣ Copy the addons/signal_bus/ folder into your Godot project's addons/ directory.
3️⃣ In Godot, go to Project Settings > Plugins, find SignalBus, and enable it.


🚀 Usage

📌 Adding Bus Signals

Define a new signal and add it to SignalBus:

SignalBus.add_signal_to_bus("on_player_hit", [
    {"name": "damage", "type": TYPE_INT},
    {"name": "source", "type": TYPE_OBJECT},
])

🔗 Connecting to Bus Signals

Connect a script method to a signal in SignalBus:

func _ready():
    SignalBus.connect("on_bus_signal_added", connect_new_signal)

def connect_new_signal(name: String):
    # Looking for 'on_player_attack' signal
    if name == "on_player_attack":
        SignalBus.connect("on_player_attack", player_attacking)

def player_attacking():
    print("Player is attacking!")

📢 Emitting Bus Signals

Emit a signal using SignalBus:

SignalBus.emit_signal("on_player_hit")

❌ Removing Bus Signals

Remove an existing signal from SignalBus:

SignalBus.remove_signal_from_bus("on_player_hit")

📝 License

This plugin is open-source and licensed under MIT License. Feel free to use, modify, and distribute it as needed.

📢 Feedback is welcome! 🚀

Version

1.0

Engine

4.3

Category

Tools

Download

Version1.0
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author