123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.SceneManagement;
- using System;
- using System.Runtime.InteropServices;
- public class Menu_Buttons : MonoBehaviour
- {
- public Button playButton, xButton;
- public string website;
- [DllImport("__Internal")]
- private static extern void CreateIFrame();
- // Start is called before the first frame update
- void Start()
- {
- playButton.onClick.AddListener(GoToLink);
- xButton.onClick.AddListener(ExitMenu);
- gameObject.tag = "TempTag";
- GameObject[] panels = GameObject.FindGameObjectsWithTag("Panel");
- gameObject.tag = "Panel";
- foreach (GameObject panel in panels)
- {
- Destroy(panel);
- }
- }
- private void GoToLink()
- {
- CreateIFrame();
- //SceneManager.LoadScene("Browser");
- //Application.OpenURL(website);
- }
- private void ExitMenu()
- {
- Time.timeScale = 1;
- Destroy(gameObject);
- }
- }
|