Skip to content

Commit

Permalink
added unity event listener (react like)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thooto committed Jun 7, 2019
1 parent 625fce8 commit f54007e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Unity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
} else {
console.warn('vue-unity-webgl: you\'ve sent a message to the Unity content, but it wasn\t instantiated yet.')
}
},
on(eventName, eventCallback) {
window.ReactUnityWebGL[eventName] = parameter => {
return eventCallback(parameter);
};
}
},
beforeMount() {
Expand Down

0 comments on commit f54007e

Please sign in to comment.