Webplayer unity.sendMessage - possibility to retrict access?

Hi there,

I’m working with webplayer and have some communiction between webplayer and embedding website via unit.sendMessage(…). In my tests i found out, that you can call every function, if you just know object’s and function’s name. Is there a way to restrict access to objects/methods (e.g. via whitelist/blacklist, …) ?

Example:

(embedded in Webplayer.html’s javascript ):

// get unity object
function GetUnity() {
if (typeof unityObject != “undefined”){
info(“GetUnity: found unity object”);
return unityObject.getObjectById(“unityPlayer”);
}
return null;
}

// call to Object.FunctionName(“Parameter”) in current scene.
var unity = GetUnity();
unity.SendMessage(“Object”, “FunctionName”, “Parameter”);

What i want:
Restrict access to one object (to handle and validate calls).


Please don’t come up with “i belive…”, “i think…” answers - this is development and not religion.

Thats not possible at the time. Unity lacks a [ExportFunction] attribute to declare what functions exist in the web handling (similar to flash) at least at the moment.

But we can hope that this is going to change along Unity 4.x

Thanks for your fast response. I’ll have a look at changelog for next unity version.