- Home /
Launch Web browser & web site from GUI
is it possible in Unity to say launch a web browser and take someone to a web page URL by clicking on text inside of say a GUI pop Up window? And if so how would that be done?
Answer by RecChemForbin · Nov 14, 2011 at 04:09 AM
The way I've done this is by using:
if(GUILayout.Button("Visit Web Site"))
{
Application.OpenURL("http://www.yoursite.com");
}
so I bet by changing the button to :
GUILayout.Box
you can get needed results
No, if you change it to GUILayout.Box it'll no longer be clickable. You need to use a button for this.
Thanks guys, but say I have an interactive shop and I want to have a little pop up GUI for each product in the shop and a different web link for each product, is that doable and if so how?
I don't know that you can have pop-up windows for new Unity scenes, but one way you may approach it is to break up each product into a new scene that stays in the same "window", then have the button link to the web site for purchase or whatever your needing which would pop up into a browser window. You can customize your GUI skin to make your buttons appear however you like in the editor and photoshop. there very well may be other ways to approach this that suits you better though
http://unity3d.com/support/resources/assets/built-in-gui-skin
hope that helps a little!
Thanks RecChemForbin, I've hered of making a scene load into an existing scene, how is this done and can I do it for multiple produts? I want to put atleast 100 or so products into my first person perspective gift shop and have an information pop up containing a more detailed picture of the product and a web link that is clickable that takes them to the product page online. How can I do this?