Where do I put this:
var params = {
disableContextMenu: true
};
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 600, 450, params);
I want to disable right click context menu within the webplayer.
Where do I put this:
var params = {
disableContextMenu: true
};
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 600, 450, params);
I want to disable right click context menu within the webplayer.
IJM, you got to apply this parameter several times in your HTML file. Check out the file in the attach, and look for all the instances of disableContextMenu
parameter.
If you want to disable right-click permanently in all future builds, just replace the file located at C:\Program Files\Unity\Editor\Data\Resources\Web Player Sample.html
with the one in attach.
This will give you a 100% x 100% web player with right click disabled. This is my own favorite I use a lot
P.S. backup your old Web Player Sample.html file first
423952–14803–$Web Player Sample.zip (2.44 KB)
Here’s also a HTML template for Unity 3.0 (attach). It displays your Unity 3 content full screen inside the browser window, with no margins and with the right-click menu disabled.
You should extract it to folder:
C:\Program Files (x86)\Unity\Editor\Data\Resources\WebPlayerTemplates
Tags: unity, unity3d, disable right click, disable context menu, disableContextMenu
474316–16665–$100x100.zip (32.8 KB)
It’s a very good code!