gree / unity-webview

zlib License
2.22k stars 684 forks source link

Using experimental/monopinvokecallback with unity 2017 #232

Open whimsica opened 6 years ago

whimsica commented 6 years ago

Is there a way to update this experimental branch with all the changes that would allow it to work with Unity 2017?

Could it be added to the master? It seems to work great. With it I can have unity call javascript and javascript call unity sequentially so they can stay in sync. Without it communication occurs randomly.

KojiNakamaru commented 6 years ago

I'll later consider to merge the branch into master. The current event-based mechanism may not be fast but is safe as it won't cause any lock. The modification in experimental/monopinovkecallback, on the other hand, needs to be carefully utilized so maybe I should add a flag to switch between the current event-based mechanism and this mono pinvoke one.

For now, I've merged master into experimental/monopinvokecallback and updated binaries: https://github.com/gree/unity-webview/commit/0f13b7165e8aa79c4b80232571f3f691cf051ba0 https://github.com/gree/unity-webview/commit/92f961479eeeeda5c7acd3df24d3b2d3260d1461

whimsica commented 6 years ago

Sounds like a wise idea to give people a choice.