react-unity-webgl
react-unity-webgl copied to clipboard
UnityContent: support multiple event handlers
- remove IUnityEvent
- add UnityEvents class
- AddEventListener() adds a callback for an event name
- DispatchEvent() calls all callbacks for an event name
- errors from event handlers are ignored
- the first event handler returning truthy aborts dispatch
- UnityContent
- add UnityEvents class property for global events
- only install one callback per global event name
- add UnityEvents instance property for instance events
- some other minor fixes I noticed while developing the code
Fixes #109