using UnityEngine; using UnityEngine.UI; namespace MoleMole { public class MonoTestUI : BaseMonoCanvas { public GameObject MainCamera; public GameObject MainMenu_SpaceShip; public bool testLocalization; public bool disableNetWork; public Avatar3dModelContext avatar3dModelContext; public bool isBenchmark; private void CreateSingleButtonTemplate() { GeneralDialogContext generalDialogContext = new GeneralDialogContext(); generalDialogContext.type = GeneralDialogContext.ButtonType.SingleButton; generalDialogContext.title = "TestUI"; generalDialogContext.desc = LocalizationGeneralLogic.GetText("Menu_Title_Tips"); BaseDialogContext dialogContext = generalDialogContext; Singleton.Instance.ShowDialog(dialogContext); } private void CreateDoubleButtonTemplate() { GeneralDialogContext generalDialogContext = new GeneralDialogContext(); generalDialogContext.type = GeneralDialogContext.ButtonType.DoubleButton; generalDialogContext.title = "TestUI"; generalDialogContext.desc = LocalizationGeneralLogic.GetText("Menu_Title_Tips"); generalDialogContext.notDestroyAfterTouchBG = true; BaseDialogContext dialogContext = generalDialogContext; Singleton.Instance.ShowDialog(dialogContext); } public void Awake() { GlobalVars.DISABLE_NETWORK_DEBUG = disableNetWork; SuperDebug.DEBUG_SWITCH[6] = true; MainUIData.USE_VIEW_CACHING = false; GeneralLogicManager.InitAll(); Singleton.Instance.SetMainCanvas(this); Singleton.Instance.PushSoundBankScale(new string[3] { "All_In_One_Bank", "BK_Global", "BK_Events" }); Singleton.Instance.InitTechTree(); } public override void Start() { TestUIContext widget = new TestUIContext(base.gameObject); Singleton.Instance.ShowWidget(widget); TestLocalization(); if (!disableNetWork) { StartCoroutine(Singleton.Instance.ConnectGlobalDispatchServer(Login)); } else { Login(); } PostStartHandleBenchmark(); if (Singleton.Instance == null) { Singleton.Create(); Singleton.Instance.InitAtAwake(); Singleton.Instance.InitAtStart(); } base.Start(); } private void Login() { Singleton.Instance.QuickLogin(); } public void TestLocalization() { if (!testLocalization) { return; } Text[] componentsInChildren = GetComponentsInChildren(); foreach (Text text in componentsInChildren) { if (text.GetComponent() == null) { text.text = "XXXXX"; } } } public override GameObject GetSpaceShipObj() { return MainMenu_SpaceShip; } private void PostStartHandleBenchmark() { if (GlobalVars.IS_BENCHMARK || isBenchmark) { Screen.sleepTimeout = -1; SuperDebug.CloseAllDebugs(); GameObject gameObject = new GameObject(); Object.DontDestroyOnLoad(gameObject); gameObject.name = "__Benchmark"; gameObject.AddComponent(); } } } }