{"id":15068081,"url":"https://github.com/mrrobinofficial/unreal-eventbus","last_synced_at":"2025-04-10T16:13:40.952Z","repository":{"id":252149175,"uuid":"839550639","full_name":"MrRobinOfficial/Unreal-EventBus","owner":"MrRobinOfficial","description":"The Event Subsystem is an event-based communication within the game. It enables a more modular and maintainable architecture.","archived":false,"fork":false,"pushed_at":"2024-08-12T11:30:25.000Z","size":12,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T14:06:17.957Z","etag":null,"topics":["cplusplus","cpp","event","eventbus","plugin","unreal-engine","unreal-engine-plugin"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrRobinOfficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-07T21:02:17.000Z","updated_at":"2025-02-20T12:40:01.000Z","dependencies_parsed_at":"2025-02-17T13:37:17.853Z","dependency_job_id":"e8dba944-abc4-43e4-97dc-2d6a8292609a","html_url":"https://github.com/MrRobinOfficial/Unreal-EventBus","commit_stats":null,"previous_names":["mrrobinofficial/unreal-eventbus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FUnreal-EventBus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FUnreal-EventBus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FUnreal-EventBus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FUnreal-EventBus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrRobinOfficial","download_url":"https://codeload.github.com/MrRobinOfficial/Unreal-EventBus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248251579,"owners_count":21072691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","event","eventbus","plugin","unreal-engine","unreal-engine-plugin"],"created_at":"2024-09-25T01:30:18.442Z","updated_at":"2025-04-10T16:13:40.937Z","avatar_url":"https://github.com/MrRobinOfficial.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Banner](Resources/Banner.png)\n\n\u003cdiv align=\"center\"\u003e\n  \n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mrrobinofficial/unreal-eventbus/blob/HEAD/LICENSE.txt)\n![plugin-status](https://img.shields.io/badge/plugin_status-ready_to_use-green)\n![maintenance-status](https://img.shields.io/badge/maintenance-passively--maintained-yellowgreen.svg)\n\n\u003c/div\u003e\n\n## ⚙️ Supported Versions\n\nThis plug-in was last built against Windows, Unreal Engine 5.4+.\n\nHowever, this code should work on other Unreal Engine versions.\n\n## ⚒️ Installation\n\nYou can install from the [release section](https://github.com/MrRobinOfficial/Unreal-EventBus/releases/latest).\n\nAlternatively, you can install this plugin via terminal with [*git*](https://git-scm.com/).\n\n_Here is the command for installing it_:\n\n```console\ngit clone git@github.com:MrRobinOfficial/Unreal-EventBus.git EventBus\n```\n\n## 📝 Quick guide\n\nThis plugin features a subsystem named `UEventSubsystem`, which enables you to register and invoke events. The event subsystem maintains a dictionary of events and their corresponding callbacks. These callbacks are stored in a list, allowing multiple callbacks to be registered for the same event. This design promotes a modular and maintainable approach to event-based systems.\n\nThe subsystem supports two types of invocation: `UEventSubsystem::Invoke()` and `UEventSubsystem::InvokeWithPayload()`. The payload is a `UObject` pointer that can be used to pass data between callbacks.\n\nInside that class, there a couple of functions that you can use.\n\n### Getting the event subsystem\n\n```cpp\n#include \"EventSubsystem.h\"\n\nUGameInstance* GameInstance = ...;\nauto* EventSubsystem = GameInstance-\u003eGetSubsystem\u003cUEventSubsystem\u003e();\n```\n\n### Registering events\n\n```cpp\nUEventSubsystem* EventSubsystem = ...;\n\nFOnEventSignature Delegate;\nDelegate.BindUObject(this, \u0026UEventSubsystem::OnPlayerDied);\nEventSubsystem-\u003eRegisterEvent(TEXT(\"player_died\"), Delegate);\n\n// Callback will be invoked when `player_died` event is invoked\nUFUNCTION()\nvoid OnPlayerDied(UObject* Payload) { }\n```\n\n### Unregistering events\n\n#### With specific callback\n\n```cpp\nUEventSubsystem* EventSubsystem = ...;\n\nFOnEventSignature Delegate;\nDelegate.BindUObject(this, \u0026UEventSubsystem::OnPlayerDied);\nEventSubsystem-\u003eUnregisterEvent(TEXT(\"player_died\"), Delegate);\n\n// Callback will be invoked when `player_died` event is invoked\nUFUNCTION()\nvoid OnPlayerDied(UObject* Payload) { }\n```\n\n#### Unregistering all events\n\n```cpp\nUEventSubsystem* EventSubsystem = ...;\nEventSubsystem-\u003eUnregisterAllEvents(TEXT(\"player_died\"));\n```\n\n### Invoking events\n\n#### With payload\n\n```cpp\nUObject* Payload = ...;\nEventSubsystem-\u003eInvokeWithPayload(TEXT(\"player_died\"), Payload);\n```\n\n#### Without payload\n\n```cpp\nEventSubsystem-\u003eInvokeWithPayload(TEXT(\"player_died\"));\n```\n\n## 🆘 Support\nIf you have any questions or issue, just write either to my [YouTube channel](https://www.youtube.com/@mrrobinofficial), [Email](mailto:mrrobin123mail@gmail.com) or [Twitter DM](https://twitter.com/MrRobinOfficial).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrobinofficial%2Funreal-eventbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrrobinofficial%2Funreal-eventbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrobinofficial%2Funreal-eventbus/lists"}