ChallengeOptionView.cs 798 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class ChallengeOptionView : MonoBehaviour
  6. {
  7. void Start() {
  8. HomeMgr.CacheView(this);
  9. }
  10. void OnDestroy() {
  11. HomeMgr.RemoveCacheView(this);
  12. }
  13. public void StartGame(int gameType) {
  14. if (GlobalData.pkMatchType == PKMatchType.LocalPK) {
  15. if (gameType == 3) gameType = 6;
  16. else if (gameType == 4) gameType = 7;
  17. else if (gameType == 5) gameType = 8;
  18. }
  19. GameMgr.gameType = gameType;
  20. AudioMgr.ins.PlayBtn();
  21. SceneManager.LoadScene("GameChallenge", LoadSceneMode.Single);
  22. }
  23. public void back() {
  24. AudioMgr.ins.PlayBtn();
  25. Destroy(this.gameObject);
  26. }
  27. }