react-unity-webgl icon indicating copy to clipboard operation
react-unity-webgl copied to clipboard

UnityContent: support multiple event handlers

Open stefanb2 opened this issue 5 years ago • 0 comments

  • 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

stefanb2 avatar Aug 14 '20 21:08 stefanb2