1234567891011121314151617181920212223242526272829 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.SceneManagement;
- using System.Runtime.InteropServices;
- public class Goto : MonoBehaviour
- {
- [DllImport("__Internal")]
- private static extern void gotoUnity(int type);
- public string sceneName;
- public int type;
- // Use this for initialization
- void Start()
- {
- GetComponent<Button>().onClick.AddListener(OnClick);
- }
- private void OnClick()
- {
- //SceneManager.LoadScene("light");//level1ΪÎÒÃÇÒªÇл»µ½µÄ³¡¾°
- //SceneManager.LoadScene(sceneName);
- gotoUnity(type);
- //Application.LoadLevel(sceneName);
- }
- }
|