Skip to content

Conversation

stefanb2
Copy link

  • 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

Fixes building & testing on case-sensitive file system.
- 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

Fixes jeffreylanters#109
Events which are dispatched via triggerUnityEvents() are instance
specific events that do not need a global event handler attached to
ReactUnityWebGL object. All other event names are assumed to be global
ones.

Fixes jeffreylanters#109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event handler for Unity Events is global
1 participant