Add icon
This commit is contained in:
1 parent
376e52e323
commit
7b78da9076
23 files changed
+861
-6208
No files matched your search
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Web : MonoBehaviour
|
||||
{
|
||||
[Header("UI")]
|
||||
public Button targetButton;
|
||||
|
||||
[Header("網址")]
|
||||
public string targetUrl = "www.youtube.com/watch?v=dQw4w9WgXcQ";
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (targetButton != null)
|
||||
{
|
||||
targetButton.onClick.AddListener(OnButtonClicked);
|
||||
}
|
||||
}
|
||||
|
||||
void OnButtonClicked()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(targetUrl))
|
||||
{
|
||||
Application.OpenURL(targetUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user