using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class HomeView : MonoBehaviour { void Start() { if (GameObject.Find("Bluetooth") == null) { GameObject bluetooth = new GameObject("Bluetooth"); // bluetooth.AddComponent(); // bluetooth.AddComponent(); // bluetooth.AddComponent(); DontDestroyOnLoad(bluetooth); } AudioMgr.init(); } public void GoTo(string target) { switch (target) { case "闯关": AudioMgr.ins.PlayBtn(); GameObject.Instantiate(Resources.Load("Prefabs/Views/ChallengeReadyView"), Vector3.zero, new Quaternion()); break; case "限时": GameMgr.gameMode = 2; SceneManager.LoadScene("Game", LoadSceneMode.Single); break; case "对战": GameMgr.gameMode = 3; SceneManager.LoadScene("Game", LoadSceneMode.Single); break; default: break; } } }