hi,
Looking for examples to call external js function from webgl exports.
Br,
peter
hi,
Looking for examples to call external js function from webgl exports.
Br,
peter
It’s probably the same as it was for WebPlayer:
Application.ExternalCall("MyJavascriptFunctionName", "Hello Javascript function!");
@sluice his answer is correct, and the easiest way to invoke Javascript.
However, there are other, currently not well documented ways of doing things that allow you to have fast and integrated js interaction while providing C# wrappers for JS yourself; while for more complex C# types you’ll have to do the marshalling yourself (unlike p/invokes), it allows you to provide a jslib file (which isn’t much more then an emscripten module), and then through [DllImport(“__Internal”)], create C# bindings to call into it.
We’ll provide examples soon.
@RalphH
Nice, looking forward to this!
Can’t wait to try it out!
Actually check the Unity 5.0 manual, it does contain a sample on how to do this.
Where can I find the Unity 5.0 Beta manual / documentation?
I think it’s not online yet, but is installed locally on your system with the beta.