SetUpView1.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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
  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. public void GoToGameSetupView() {
  16. AudioMgr.ins.PlayBtn();
  17. GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/SetUpView"), Vector3.zero, new Quaternion());
  18. }
  19. public void AboutUs() {
  20. AudioMgr.ins.PlayBtn();
  21. // PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("tip_about-us"));
  22. GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AboutUsView"), transform);
  23. }
  24. public void GoToUserAgreement() {
  25. AudioMgr.ins.PlayBtn();
  26. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  27. o.GetComponent<AgreementView>().EnterUserAgreement();
  28. }
  29. public void GoToPrivacyAgreement() {
  30. AudioMgr.ins.PlayBtn();
  31. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  32. o.GetComponent<AgreementView>().EnterPrivacyAgreement();
  33. }
  34. public void QuitGame() {
  35. AudioMgr.ins.PlayBtn();
  36. Application.Quit();
  37. }
  38. public void QuitLogin()
  39. {
  40. AudioMgr.ins.PlayBtn();
  41. PlayerPrefs.DeleteKey("IdAndToken");
  42. SceneManager.LoadScene("Login", LoadSceneMode.Single);
  43. if (UserPlayer.ins != null) UserPlayer.ins.Close();
  44. }
  45. public void Back() {
  46. AudioMgr.ins.PlayBtn();
  47. Destroy(this.gameObject);
  48. }
  49. }