I am doing this in my webpage containing the player:
function SaySomethingToUnity(var objindex){
u.getUnity().SendMessage("ObjectManager", "MyFunction", objindex);
}
and this:
<button type="button" onclick="SaySomethingToUnity(1)">Click Me!</button>
then in Unity
private var focusobject:int;
function MyFunction(param: int){
focusobject=param;
FocusOnObjects();
}
function FocusOnObjects () {
...
var bounds = new Bounds(GameObjects[focusobject].transform.position, Vector3.zero);
...
}
This is in order to pass a value depending on which object I am going to focus on when I click a web button.
The player does not load, if I use the original form from the documentation everything is fine, can anyone tell me why?
Many thanks
Nic