GameStartJumper.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Api;
  2. using Game;
  3. using Message;
  4. using Plugins.CxShine.page;
  5. using UnityEngine;
  6. using UnityEngine.SceneManagement;
  7. namespace UI
  8. {
  9. public class GameStartJumper
  10. {
  11. public static void JumpGameScene(string battleSession)
  12. {
  13. PageManagerComp.singleton.HideUI();
  14. MessageComp.Instance.IntervalTime = 0.5f;
  15. Debug.Log("on jump game " + battleSession + "===");
  16. GameCore.Instance.curBattleSession = battleSession;
  17. SceneManager.LoadScene("Battle");
  18. }
  19. public static void BackToUI()
  20. {
  21. MessageComp.Instance.IntervalTime = 1f;
  22. SceneManager.LoadScene("Hall");
  23. PageManagerComp.singleton.DisplayUI();
  24. HallComp.Instance.BackToHallAndRefreshUI();
  25. }
  26. public static void PlayerQuitGame()
  27. {
  28. ApiComp.Instance.playerQuitGame(GameCore.Instance.curBattleSession, data =>
  29. {
  30. Debug.Log("player quit game success");
  31. BackToUI();
  32. }, (code, msg) =>
  33. {
  34. Debug.Log("player quit game fail");
  35. });
  36. }
  37. }
  38. }