Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ericfreeman/unityeventaggregator
Simple event aggregation for Unity3D.
https://github.com/ericfreeman/unityeventaggregator
c-sharp event-aggregation events unity3d
Last synced: about 2 months ago
JSON representation
Simple event aggregation for Unity3D.
- Host: GitHub
- URL: https://github.com/ericfreeman/unityeventaggregator
- Owner: EricFreeman
- Created: 2014-12-11T02:15:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-10-01T18:50:48.000Z (over 2 years ago)
- Last Synced: 2023-08-05T15:13:14.122Z (over 1 year ago)
- Topics: c-sharp, event-aggregation, events, unity3d
- Language: C#
- Homepage:
- Size: 234 KB
- Stars: 30
- Watchers: 9
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Unity Event Aggregator
======================Event aggregation in Unity made easy! Decouple your GameObjects for simpler and cleaner code.
#### Why Should I Care?
[Look at how gross this is.](https://docs.unity3d.com/410/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html) Disgusting, huh? Now what if there was an easy way to send messages to other game objects in Unity3D without coupling everything to hell or using skittles magic?#### That way is here.
Just drop [the .dll](https://github.com/EricFreeman/UnityEventAggregator/releases/tag/v1.0.0.0) into your existing Unity project and get started. Messages must be a class.To start listening to events, your MonoBehaviour must also inherit from `IListener<(message)>`. This will create the handler for the message.
Make sure you register and unregister with the `EventAggregator` in your MonoBehaviour's `Start` and `OnDestroy` methods. I'll probably create a base class to inherit from that will do this automatically for you...when I'm feeling less lazy.
## Download
[v1.0.0.0 Download](https://github.com/EricFreeman/UnityEventAggregator/releases/tag/v1.0.0.0)## Example Usage
https://github.com/EricFreeman/1800ContactsEndlessRunner/blob/master/src/Assets/Scripts/UI/Score.cs