Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Conversation

@prostolyubo
Copy link
Contributor

Previously: method names were passed as strings, a SendMessage was used that searches for a monobehaviour with a given name (not quite reliable/efficient way of passing things in Unity).
Currently: methods are marshalled as proper callbacks. A MonoBehaviour in the scene is no longer necessary for this awesome system to work.

I also added small fixes to jslib so that things can be passed around between functions without using window. I suppose it can be further optimized, but I don't know how it ended up so complicated in the first place so I left it generally intact.

@greggman greggman merged commit 097bb53 into greggman:master Mar 21, 2021
@greggman
Copy link
Owner

Thanks for this. My guess is the reason it was the way it was is that's the way I found in the docs in 2014 from my first Unity<->JS stuff. Thanks to your example I've learned better ways

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants