Loading untiy3d web player on clicking image

Home  >>  Game Development  >>  Loading untiy3d web player on clicking image

Loading untiy3d web player on clicking image

5
Jun,2014

0

Loading untiy3d web player on clicking image

Have you ever wanted to disable the untiy3D web player to auto load? Have you puled out your hair in despair?

Recently I stumbled upon this beautiful piece of code. With this, you can set an image and when clicked, load the actual unity3d web player.

Check it out here.

Basically, there is separate js script that holds dynamic loading of the untiy3d web player. When we click the image with an unique identifier, the JavaScript function LoadUnityAfterClick() fires up and loads the unity3d according to the client browser.

The method should be placed on “onClick” event of the image, with the following parameters:

LoadUnityAfterClick(

‘REAL_PATH_TO_UNITY3D_FILE’,

‘WIDTH’,

‘HEIGHT’,

‘UNIQUE_ID’

)

And, you need to put a little html code in the main page where you want to load the game, which is also given in the link.

Why use “Click and play” behavior?

Bottom line, you can have a page where you click the image and play the game. Since its not loading the unity3d file until you click the image, it saves a lot of time and gives a good complexion to the user experience.

 

Loading untiy3d web player on clicking image

Comments

comments

Leave a Reply