| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class PKGameOptionView : MonoBehaviour
- {
- void Start() {
- HomeMgr.CacheView(this);
- }
- void OnDestroy() {
- HomeMgr.RemoveCacheView(this);
- }
- public void GoTo(string target) {
- AudioMgr.ins.PlayBtn();
- switch (target)
- {
- case "双人闯关":
- if (GlobalData.pkMatchType == PKMatchType.OnlinePK) return;
- GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/ChallengeOptionView"));
- break;
- case "静止靶":
- if (GlobalData.pkMatchType == PKMatchType.OnlinePK) {
- GameObject o1 = GameObject.Instantiate(GameObject.Find("WindowViews").transform.Find("PKMatchView").gameObject);
- o1.SetActive(true);
- o1.GetComponent<PKMatchView>().loadGameAction = () => {
- GameMgr.gameType = 2;
- SceneManager.LoadScene("Game", LoadSceneMode.Single);
- };
- } else {
- GameMgr.gameType = 2;
- SceneManager.LoadScene("Game", LoadSceneMode.Single);
- }
- break;
- default:
- break;
- }
- }
- public void Back() {
- AudioMgr.ins.PlayBtn();
- Destroy(this.gameObject);
- }
- }
|