| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.SceneManagement;
- /* 设置界面1 */
- public class SettingsView : JCUnityLib.ViewBase, MenuBackInterface
- {
- void Awake() {
- if (CommonConfig.needToExamine) {
- transform.Find("Items/GameSetup").GetComponentInChildren<TextAutoLanguage>().SetText(1234560);
- transform.Find("BtnQuitGame").GetComponentInChildren<TextAutoLanguage>().SetText(1234561);
- }
- if (CommonConfig.StandaloneMode)
- {
- transform.Find("Items/BtnsRow/BtnQutiLogin").gameObject.SetActive(false);
- transform.Find("Items/BtnsRow/BtnQuitGame").transform.localPosition = Vector3.zero;
- }
- }
- void Start()
- {
- PersistenHandler.ins?.menuBackCtr.views.Add(this);
- }
- void OnDestroy()
- {
- PersistenHandler.ins?.menuBackCtr.views.Remove(this);
- }
- public bool OnMenuBack() {
- ViewMgr.Instance.DestroyView<SettingsView>();
- return true;
- }
- public void GoToGameSetupView() {
- AudioMgr.ins.PlayBtn();
- ViewMgr.Instance.ShowView<SettingsGameView>();
- // JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
- }
- public void GoToGameCourse() {
- AudioMgr.ins.PlayBtn();
- ViewMgr.Instance.ShowView<CourseView>();
- // JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
- }
- public void AboutUs() {
- AudioMgr.ins.PlayBtn();
- ViewMgr.Instance.ShowView<AboutUsView>();
- }
- public void GoToUserAgreement() {
- AudioMgr.ins.PlayBtn();
- GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
- JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
- o.GetComponent<AgreementView>().EnterUserAgreement();
- }
- public void GoToPrivacyAgreement() {
- AudioMgr.ins.PlayBtn();
- GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
- JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
- o.GetComponent<AgreementView>().EnterPrivacyAgreement();
- }
- public void QuitGame() {
- AudioMgr.ins.PlayBtn();
- Application.Quit();
- }
- public void QuitLogin()
- {
- AudioMgr.ins.PlayBtn();
- PlayerPrefs.DeleteKey(LoginMgr.LoginTokenKey);
- UserPlayer.ins?.Close();
- SceneManager.LoadScene("Login", LoadSceneMode.Single);
- }
- public void Back() {
- AudioMgr.ins.PlayBtn();
- ViewMgr.Instance.DestroyView<SettingsView>();
- }
- }
|