HomeView.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class HomeView : MonoBehaviour
  6. {
  7. void Start()
  8. {
  9. if (GameObject.Find("Bluetooth") == null) {
  10. GameObject bluetooth = new GameObject("Bluetooth");
  11. // bluetooth.AddComponent<ShootCheck>();
  12. // bluetooth.AddComponent<BluetoothBC>();
  13. // bluetooth.AddComponent<BluetoothD>();
  14. DontDestroyOnLoad(bluetooth);
  15. }
  16. AudioMgr.init();
  17. }
  18. public void GoTo(string target) {
  19. switch (target)
  20. {
  21. case "闯关":
  22. AudioMgr.ins.PlayBtn();
  23. GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/ChallengeReadyView"), Vector3.zero, new Quaternion());
  24. break;
  25. case "限时":
  26. GameMgr.gameMode = 2;
  27. SceneManager.LoadScene("Game", LoadSceneMode.Single);
  28. break;
  29. case "对战":
  30. GameMgr.gameMode = 3;
  31. SceneManager.LoadScene("Game", LoadSceneMode.Single);
  32. break;
  33. default:
  34. break;
  35. }
  36. }
  37. }