| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- /* 界面-游戏开始 */
- public class GameStartView : JCUnityLib.ViewBase, MenuBackInterface
- {
- public static GameStartView ins;
- void Start() {
- ins = this;
- PersistenHandler.ins?.menuBackCtr.views.Add(this);
- TopBarView.NeedShowIt(this);
- }
- void OnDestroy() {
- if (ins == this) ins = null;
- PersistenHandler.ins?.menuBackCtr.views.Remove(this);
- TopBarView.DontNeedShowIt(this);
- }
-
- public bool OnMenuBack() {
- ViewMgr.Instance.DestroyView<GameStartView>();
- return true;
- }
-
- public void GoTo(string target) {
- AudioMgr.ins.PlayBtn();
- switch (target)
- {
- case "闯关":
- GlobalDataTemp.pkMatchType = PKMatchType.None;
- ViewMgr.Instance.ShowView<ChallengeOptionView>();
- break;
- case "限时":
- GlobalData.pkMatchType = PKMatchType.None;
- GameMgr.gameType = 1;
- SceneManager.LoadScene("Game", LoadSceneMode.Single);
- break;
- case "PK":
- GlobalDataTemp.pkMatchType = PKMatchType.LocalPK;
- ViewMgr.Instance.ShowView<RoleSelectView>();
- break;
- default:
- break;
- }
- }
- public void Back() {
- AudioMgr.ins.PlayBtn();
- ViewMgr.Instance.DestroyView<GameStartView>();
- }
- }
|