GUI Button that is linked to a HTML page

Hey people

I have a unity webplayer embedded into my website. Is there a way of getting a GUI Button within the unity project to link to a HTML page ?

for example here is the code I have currently

var customGuiStyle : GUIStyle;

function OnGUI () { if (GUI.Button (Rect (27,17,100,25), "Main Menu", customGuiStyle)) { Application.LoadLevel("Main Menu");

   }

}

What this code does is load the "Main Menu" level i originally had. Now i have constructed a HTML page which now serves as the main menu.

What I need is for this script to take the user from the unity project to the HTML page engine-main-menu.html.

Is this possible ????

Cheers

2 Answers

2

This is probably the most expedient api for you: http://unity3d.com/support/documentation/ScriptReference/Application.ExternalEval.html

You can have it load any page

You could use the function OpenURL.

Take also a look at this reference page: Unity Web Player and browser communication