- Home /
i want work link(internet site) in GUI Button
uhm...
how can i use GUI Button link system?
i can't make linked Button(internet explorer)
Answer by whydoidoit · May 29, 2012 at 05:05 PM
You can use this code to open a URL:
if(GUILayout.Button("Click Me")) {
Application.OpenURL("http://www.whydoidoit.com");
}
Apparently you can load other website urls, not sure why you would want to though ;)
Hey I have a similar problem. Ins$$anonymous$$d of a GUI Button I'm using a box collider on some text. This is my script:
function On$$anonymous$$ouseUp { Application.OpenURL("http://www.submachineworld.com"); }
It's pretty simple, but when I compile it gives me two error messages: BCE0044: expecting (, found '{' and BCE0044: expecting EOF, found '}' What is wrong with it?
Lol never$$anonymous$$d, I made it work. I was missing brackets.
Answer by ow3n · Jun 23, 2017 at 07:44 PM
Use Application.OpenURL() called from inside a button.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AppController : MonoBehaviour {
public void LaunchUrl(string url){
Debug.Log("You have clicked the button!");
Application.OpenURL(url);
}
}
Your answer
Follow this Question
Related Questions
I want to move foward a object using a button? 1 Answer
GUI button-play a 3d model animation 0 Answers
How would I use a Gui Button to shoot? 1 Answer
show another gui menu 0 Answers
GUI using keyboard as input? 0 Answers