Since WebGL is javascript, if you had other elements in the page relying on values from unity, is there any support going towards bound access to those variables? This could be really useful for integrating WebGL canvases throughout existing web applications.
For sure there is a way to communicate back and fourth with Javascript.
My best bet is that it is the same as with the WebPlayer:
Application.ExternalCall("MyJavascriptFunction", myData);
true, but how would I go about say
void Update() {
MyBoundData.position += Vector3.up * 4.0f * Time.deltaTime;
}
and simply do this in javascript
$("MyParagraphID").val(MyUnityObject.MyBoundData.position.x);
and do this without a ton of sync calls in high level code.
It just seems like a very possible thing when there’s no barrier of a webPlayer
“It just seems like a very possible thing when there’s no barrier of a webPlayer”
This is somewhat of a misassumption about how we convert the C# types; they are all represented by data in a singular typed array, which is shared by both the converted managed code and the engine code, through a few conversion steps; explicit marshalling from C# types to JavaScript types will always need to happen.
Thanks for jumping in, you see the benefit of binding at least, unfortunate that it isn’t an option. If I wind up in a situation which could use it in unity 5… I’d just have to keep doing it like the web player. Again, thanks for the clarification.