using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; /* 界面-游戏开始 */ public class GameStartView : MonoBehaviour, MenuBackInterface { public static GameStartView ins; void Start() { ins = this; PersistenHandler.ins?.menuBackCtr.views.Add(this); HomeMgr.CacheView(this); } void OnDestroy() { if (ins == this) ins = null; PersistenHandler.ins?.menuBackCtr.views.Remove(this); HomeMgr.RemoveCacheView(this); } public bool OnMenuBack() { Destroy(gameObject); return true; } public void GoTo(string target) { AudioMgr.ins.PlayBtn(); switch (target) { case "闯关": GlobalDataTemp.pkMatchType = PKMatchType.None; GameObject.Instantiate(Resources.Load("Prefabs/Views/ChallengeOptionView")); break; case "限时": GlobalData.pkMatchType = PKMatchType.None; GameMgr.gameType = 1; SceneManager.LoadScene("Game", LoadSceneMode.Single); break; case "PK": GlobalDataTemp.pkMatchType = PKMatchType.LocalPK; GameObject.Instantiate(Resources.Load("Prefabs/Views/RoleSelectView")); break; default: break; } } public void Back() { AudioMgr.ins.PlayBtn(); Destroy(this.gameObject); } }