{"repo":"gwiazdorrr/EventBetter","free":true,"listed":false,"github":"https://github.com/gwiazdorrr/EventBetter","clone":"git clone https://github.com/gwiazdorrr/EventBetter.git","description":"A Unity messaging/event system for the lazy","language":"C#","stars":140,"topics":["unity3d","unity"],"license":"MIT","category":"game-templates","readme_excerpt":"EventBetter A Unity pubsub/messaging/event system for the lazy. Here's why: - Raising events is alloc-free. - No interfaces to implement, no base types to derive from. - No initialization, no clean-up. - No message codes. - Coroutine/async friendly. - One source file (everything else here is just for the test environment). - Clear and readable. TL;DR: Copy EventBetter.cs anywhere to your project or add https://github.com/gwiazdorrr/EventBetter.git in Package Manager ( Add package from git URL... ). The API you need to know is EventBetter.Listen and EventBetter.Raise . Done! Example: There's no need to unlisten/unsubscribe from anything. How does it work The first parameter in Listen is the listener; as long as it is alive, the handler (the second parameter) will be invoked whenever there is a Raise called with a matching type. If the listener gets destroyed (with UnityObject.Destroy or when changing scenes), the handler will not get invoked any more and all the references will get cleaned up no later than in the next LateUpdate. It is possible thanks to UnityEngine.Object being the main citizen in the Unity world - it has a native representation with lifetime controlled entirely by the engine. There's no need to use WeakReference , ConditionalWeakTable and boilerplate like \"unsubscribe\" to avoid leaks, just keep track of the native parts. More examples Maybe you like async/await more? Or maybe you'd rather stick with good old coroutines? Back to the basic Listen , maybe you w","default_branch":null,"files":null,"tree":[],"storefront":"/r/gwiazdorrr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/gwiazdorrr/EventBetter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}