SetUpView1.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.SceneManagement;
  6. /* 设置界面1 */
  7. public class SetUpView1 : MonoBehaviour, MenuBackInterface
  8. {
  9. void Awake() {
  10. if (CommonConfig.needToExamine) {
  11. transform.Find("Items/GameSetup").GetComponentInChildren<TextAutoLanguage>().SetText(1234560);
  12. transform.Find("BtnQuitGame").GetComponentInChildren<TextAutoLanguage>().SetText(1234561);
  13. }
  14. }
  15. void Start()
  16. {
  17. PersistenHandler.ins?.menuBackCtr.views.Add(this);
  18. }
  19. void OnDestroy()
  20. {
  21. PersistenHandler.ins?.menuBackCtr.views.Remove(this);
  22. }
  23. public bool OnMenuBack() {
  24. Destroy(gameObject);
  25. return true;
  26. }
  27. public void GoToGameSetupView() {
  28. AudioMgr.ins.PlayBtn();
  29. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/SetUpView"));
  30. JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
  31. }
  32. public void GoToGameCourse() {
  33. AudioMgr.ins.PlayBtn();
  34. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/CourseView"));
  35. JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
  36. }
  37. public void AboutUs() {
  38. AudioMgr.ins.PlayBtn();
  39. GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AboutUsView"), transform);
  40. }
  41. public void GoToUserAgreement() {
  42. AudioMgr.ins.PlayBtn();
  43. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  44. JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
  45. o.GetComponent<AgreementView>().EnterUserAgreement();
  46. }
  47. public void GoToPrivacyAgreement() {
  48. AudioMgr.ins.PlayBtn();
  49. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  50. JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
  51. o.GetComponent<AgreementView>().EnterPrivacyAgreement();
  52. }
  53. public void QuitGame() {
  54. AudioMgr.ins.PlayBtn();
  55. Application.Quit();
  56. }
  57. public void QuitLogin()
  58. {
  59. AudioMgr.ins.PlayBtn();
  60. UserPlayer.ins?.Close();
  61. SceneManager.LoadScene("Login", LoadSceneMode.Single);
  62. }
  63. public void Back() {
  64. AudioMgr.ins.PlayBtn();
  65. Destroy(this.gameObject);
  66. }
  67. }