SetUpView1.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. }
  23. public void GoToUserAgreement() {
  24. AudioMgr.ins.PlayBtn();
  25. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  26. o.GetComponent<AgreementView>().EnterUserAgreement();
  27. }
  28. public void GoToPrivacyAgreement() {
  29. AudioMgr.ins.PlayBtn();
  30. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  31. o.GetComponent<AgreementView>().EnterPrivacyAgreement();
  32. }
  33. public void QuitGame() {
  34. AudioMgr.ins.PlayBtn();
  35. Application.Quit();
  36. }
  37. public void QuitLogin()
  38. {
  39. AudioMgr.ins.PlayBtn();
  40. PlayerPrefs.DeleteKey("IdAndToken");
  41. SceneManager.LoadScene("Login", LoadSceneMode.Single);
  42. if (UserPlayer.ins != null) UserPlayer.ins.Close();
  43. }
  44. public void Back() {
  45. AudioMgr.ins.PlayBtn();
  46. Destroy(this.gameObject);
  47. }
  48. }