SetUpView1.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.Instantiate(Resources.Load<GameObject>("Prefabs/Views/SetUpView"), Vector3.zero, new Quaternion());
  30. }
  31. public void AboutUs() {
  32. AudioMgr.ins.PlayBtn();
  33. // PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("tip_about-us"));
  34. GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AboutUsView"), transform);
  35. }
  36. public void GoToUserAgreement() {
  37. AudioMgr.ins.PlayBtn();
  38. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  39. o.GetComponent<AgreementView>().EnterUserAgreement();
  40. }
  41. public void GoToPrivacyAgreement() {
  42. AudioMgr.ins.PlayBtn();
  43. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  44. o.GetComponent<AgreementView>().EnterPrivacyAgreement();
  45. }
  46. public void QuitGame() {
  47. AudioMgr.ins.PlayBtn();
  48. Application.Quit();
  49. }
  50. public void QuitLogin()
  51. {
  52. AudioMgr.ins.PlayBtn();
  53. PlayerPrefs.DeleteKey("IdAndToken");
  54. SceneManager.LoadScene("Login", LoadSceneMode.Single);
  55. if (UserPlayer.ins != null) UserPlayer.ins.Close();
  56. }
  57. public void Back() {
  58. AudioMgr.ins.PlayBtn();
  59. Destroy(this.gameObject);
  60. }
  61. }