Back to Browse

Unity - Design Pattern: Event Bus - 2023 Solution

1.0K views
Sep 26, 2023
14:37

In this video, I'm going to show y'all my new event bus system solution that I'm going to be using on my next projects. This system basically consists of a static EventBus class that manages the listeners and events to avoid coupling between listeners and event invokers. The reason behind this static class choice is simply because this class doesn't need to be in the scene as an actual game object. The static keyword will let the class instance be available throughout the whole game cycle, so this way we don't need to use singletons and DontDestroyOnLoad. We can simply access, invoke, or subscribe to the events we need at any point in the game. More details were explained in the video. If you want to see an actual use case of this system, in the Ghosts 'n Goblins game clone that I'm recreating in Unity, I'll be using this EventBus system on the Ladder State. So if you want to follow up on this series, you can check out the playlist here: https://youtube.com/playlist?list=PL_pZzcQanwMlmNDlGhwrd8lAsYe_x87CA&si=uHJZLqXLxI7EKeuU You can download the scripts here: https://github.com/Lasanha-Dev/Unity-EventBus NEW EVENT BUS VERSION HERE: https://www.youtube.com/watch?v=FhuKp-d9MUQ&feature=youtu.be If you have any questions or suggestions, just drop a comment down below. 00:00 GlobalLogger 01:16 IEvent 01:44 IEventInvoker 02:16 IEventListener 03:01 IEventParameter 04:16 EventListenerPriority 04:50 EventDefinition 07:32 EventBus

Download

0 formats

No download links available.

Unity - Design Pattern: Event Bus - 2023 Solution | NatokHD