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().SetText(1234560); transform.Find("BtnQuitGame").GetComponentInChildren().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(); return true; } public void GoToGameSetupView() { AudioMgr.ins.PlayBtn(); ViewMgr.Instance.ShowView(); // JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1); } public void GoToGameCourse() { AudioMgr.ins.PlayBtn(); ViewMgr.Instance.ShowView(); // JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1); } public void AboutUs() { AudioMgr.ins.PlayBtn(); ViewMgr.Instance.ShowView(); } public void GoToUserAgreement() { AudioMgr.ins.PlayBtn(); GameObject o = GameObject.Instantiate(Resources.Load("Prefabs/Views/AgreementView")); JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1); o.GetComponent().EnterUserAgreement(); } public void GoToPrivacyAgreement() { AudioMgr.ins.PlayBtn(); GameObject o = GameObject.Instantiate(Resources.Load("Prefabs/Views/AgreementView")); JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1); o.GetComponent().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(); } }