| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- /* 界面-挑战关卡选择 */
- public class ChallengeOptionView : MonoBehaviour
- {
- void Start() {
- HomeMgr.CacheView(this);
- }
- void OnDestroy() {
- HomeMgr.RemoveCacheView(this);
- }
- public void StartGame(int gameType) {
- AudioMgr.ins.PlayBtn();
- if (GlobalDataTemp.pkMatchType == PKMatchType.OnlinePK) {
- int newGameType = 0;
- if (gameType == 3) newGameType = 10;
- else if (gameType == 4) newGameType = 11;
- else if (gameType == 5) newGameType = 12;
- GlobalDataTemp.matchGameType = newGameType;
- GameObject.Instantiate(GameObject.Find("WindowViews").transform.Find("PKMatchView").gameObject).SetActive(true);
- return;
- }
- if (GlobalDataTemp.pkMatchType == PKMatchType.LocalPK) {
- if (gameType == 3) gameType = 6;
- else if (gameType == 4) gameType = 7;
- else if (gameType == 5) gameType = 8;
- }
- GlobalData.pkMatchType = GlobalDataTemp.pkMatchType;
- GameMgr.gameType = gameType;
- SceneManager.LoadScene("GameChallenge", LoadSceneMode.Single);
- }
- public void back() {
- AudioMgr.ins.PlayBtn();
- Destroy(this.gameObject);
- }
- }
|