using System; using System.Collections; using Assets.Scripts; using Qoo; using Qoo.Application; using Qoo.Def; using Qoo.File; using Qoo.Ks; using UnityEngine; // Token: 0x0200013C RID: 316 public class UnityApp : Singleton { // Token: 0x170000F5 RID: 245 // (get) Token: 0x06000894 RID: 2196 RVA: 0x000264A0 File Offset: 0x000246A0 public bool IsInit { get { return this.m_isInit; } } // Token: 0x06000895 RID: 2197 RVA: 0x000264A8 File Offset: 0x000246A8 private void Start() { int language = PlayerPrefs.GetInt("language"); switch (language) { case 0: this.locale = LocaleEnum.Japanese; break; case 1: this.locale = LocaleEnum.English; break; case 2: this.locale = LocaleEnum.Spanish; break; default: this.locale = LocaleEnum.Japanese; break; } int selectedFont = PlayerPrefs.GetInt("font"); switch (selectedFont) { case 0: this.font = FontEnum.NewRodin; break; case 1: this.font = FontEnum.Humming; break; case 2: this.font = FontEnum.NewCezanne; break; case 3: this.font = FontEnum.Slump; break; case 4: this.font = FontEnum.UDMincho; break; default: this.font = FontEnum.NewRodin; break; } int fontSetting = PlayerPrefs.GetInt("fontsize"); switch (fontSetting) { case 0: this.preferredFontSize = 22; FontDef.SetFontInfo(new FONTINFO[] { new FONTINFO(22, 22, 1f, 0), new FONTINFO(22, 22, 1f, 0), new FONTINFO(42, 42, 1f, -1), new FONTINFO(62, 62, 1f, -2) }); break; case 1: default: this.preferredFontSize = 28; FontDef.SetFontInfo(new FONTINFO[] { new FONTINFO(22, 22, 1f, 0), new FONTINFO(28, 28, 1f, 0), new FONTINFO(42, 42, 1f, -1), new FONTINFO(62, 62, 1f, -2) }); break; } //UnityEngine.Object.DontDestroyOnLoad(this); Application.targetFrameRate = 60; Application.runInBackground = true; //Screen.SetResolution(1024, 576, false, 60); this.task = base.gameObject.AddComponent(); this.time = base.gameObject.AddComponent(); this.file = base.gameObject.AddComponent(); this.input = base.gameObject.AddComponent(); this.graph = base.gameObject.AddComponent(); this.sound = base.gameObject.AddComponent(); UnityTask.SetMainTask(this.InitData()); this.m_isInit = false; } // Token: 0x06000896 RID: 2198 RVA: 0x00026534 File Offset: 0x00024734 private void Update() { } // Token: 0x06000897 RID: 2199 RVA: 0x00026538 File Offset: 0x00024738 private void OnEnable() { //AMAppStore.RegistrationEvent(); } // Token: 0x06000898 RID: 2200 RVA: 0x00026540 File Offset: 0x00024740 private void OnDisable() { //AMAppStore.DeleteEvent(); } // Token: 0x06000899 RID: 2201 RVA: 0x00026548 File Offset: 0x00024748 private void OnApplicationFocus(bool isFocus) { if (isFocus) { Qoo.Debug.Print("APP Focus!!"); } else { Qoo.Debug.Print("APP FocusLost!!"); } } // Token: 0x0600089A RID: 2202 RVA: 0x0002656C File Offset: 0x0002476C private void OnApplicationPause(bool pauseStatus) { if (pauseStatus) { Qoo.Debug.Print("APP PAUSE!!"); UnityApp.AutoSave(); } else { Qoo.Debug.Print("APP Resume!!"); } } // Token: 0x0600089B RID: 2203 RVA: 0x000265A0 File Offset: 0x000247A0 private void OnApplicationQuit() { Qoo.Debug.Print("APP QUIT!!"); UnityApp.AutoSave(); //AMAppStore.End(); } // Token: 0x0600089C RID: 2204 RVA: 0x000265B8 File Offset: 0x000247B8 private IEnumerator InitData() { /*this.m_LoadQueue.LoadOther("data0.nmb", "nmb/"); this.m_LoadQueue.LoadOther("data1.nmb", "nmb/");*/ this.m_LoadQueue.LoadOther("data0.JSON", "nmb/"); this.m_LoadQueue.LoadOther("data1.JSON", "nmb/"); while (!this.m_LoadQueue.IsReadEndAll()) { yield return 0; } this.CreateNmbFromJSON(); //this.CreateNmb(); this.m_LoadQueue.LoadOther("kslist.akb", "ks/"); while (!this.m_LoadQueue.IsReadEndAll()) { yield return 0; } this.CreateAkb(); // Load all fonts this.m_LoadQueue.LoadOther("h2m_font.fnt", "font/"); this.m_LoadQueue.LoadResource("h2m_font_0", "font/"); this.m_LoadQueue.LoadOther("Humming.fnt", "font/"); this.m_LoadQueue.LoadResource("Humming_0", "font/"); this.m_LoadQueue.LoadOther("New_Cezanne.fnt", "font/"); this.m_LoadQueue.LoadResource("New_Cezanne_0", "font/"); this.m_LoadQueue.LoadOther("Slump.fnt", "font/"); this.m_LoadQueue.LoadResource("Slump_0", "font/"); this.m_LoadQueue.LoadOther("UDMinchoPro.fnt", "font/"); this.m_LoadQueue.LoadResource("UDMinchoPro_0", "font/"); while (!this.m_LoadQueue.IsReadEndAll()) { yield return 0; } this.CreateFontFile(); App.Init(); this.m_isInit = true; CSVManager.init(); Qoo.Debug.Print("---Init End---"); if (UnityEngine.Debug.isDebugBuild) { SceneManager.ChangeScene(this.InitDebugScene); } else { SceneManager.ChangeScene(this.InitScene); } GameObject lcamera = GameObject.Find("LoadingCamera"); if (lcamera != null) { UnityEngine.Object.Destroy(lcamera); lcamera = null; } GameObject lsprite = GameObject.Find("LoadingSprite"); if (lsprite != null) { UnityEngine.Object.Destroy(lsprite); lsprite = null; } yield break; } // Token: 0x0600089D RID: 2205 RVA: 0x000265D4 File Offset: 0x000247D4 public int GetTimeMilli() { return this.time.GetTimeMilli(); } // Token: 0x0600089E RID: 2206 RVA: 0x000265E4 File Offset: 0x000247E4 public int FrameUpdate() { return UnityTask.FrameUpdate(); } // Token: 0x0600089F RID: 2207 RVA: 0x000265EC File Offset: 0x000247EC private void CreateAkb() { Akb.Create(this.m_LoadQueue.GetData("kslist.akb")); this.m_LoadQueue.Remove("kslist.akb"); } // Token: 0x060008A0 RID: 2208 RVA: 0x00026620 File Offset: 0x00024820 // Orignal NMB loader private void CreateNmb() { Nmb.Add(this.m_LoadQueue.GetData("data0.nmb")); Nmb.Add(this.m_LoadQueue.GetData("data1.nmb")); this.m_LoadQueue.Remove("data0.nmb"); this.m_LoadQueue.Remove("data1.nmb"); } // JSON NMB loader private void CreateNmbFromJSON() { string nmb0 = System.Text.Encoding.UTF8.GetString(this.m_LoadQueue.GetData("data0.JSON")); string nmb1 = System.Text.Encoding.UTF8.GetString(this.m_LoadQueue.GetData("data1.JSON")); Nmb.AddFromJSON(Newtonsoft.Json.JsonConvert.DeserializeObject(nmb0)); Nmb.AddFromJSON(Newtonsoft.Json.JsonConvert.DeserializeObject(nmb1)); } // Token: 0x060008A1 RID: 2209 RVA: 0x0002667C File Offset: 0x0002487C private void CreateFontFile() { this.graph.CreateFont("FOT-ニューロダン Pro B", this.m_LoadQueue.GetData("h2m_font.fnt"), this.graph.m_ManSprite.SetTexture("h2m_font_0", this.m_LoadQueue.GetObject("h2m_font_0") as Texture2D)); this.m_LoadQueue.Remove("h2m_font.fnt"); this.m_LoadQueue.Remove("h2m_font_0"); this.graph.CreateFont("FOT-ハミング Std B", this.m_LoadQueue.GetData("Humming.fnt"), this.graph.m_ManSprite.SetTexture("Humming_0", this.m_LoadQueue.GetObject("Humming_0") as Texture2D)); this.m_LoadQueue.Remove("Humming.fnt"); this.m_LoadQueue.Remove("Humming_0.png"); this.graph.CreateFont("FOT-ニューセザンヌ Pro M", this.m_LoadQueue.GetData("New_Cezanne.fnt"), this.graph.m_ManSprite.SetTexture("New_Cezanne_0", this.m_LoadQueue.GetObject("New_Cezanne_0") as Texture2D)); this.m_LoadQueue.Remove("New_Cezanne.fnt"); this.m_LoadQueue.Remove("New_Cezanne_0.png"); this.graph.CreateFont("FOT-スランプ Std DB", this.m_LoadQueue.GetData("Slump.fnt"), this.graph.m_ManSprite.SetTexture("Slump_0", this.m_LoadQueue.GetObject("Slump_0") as Texture2D)); this.m_LoadQueue.Remove("Slump.fnt"); this.m_LoadQueue.Remove("Slump_0.png"); this.graph.CreateFont("FOT-UD明朝 Pro B", this.m_LoadQueue.GetData("UDMinchoPro.fnt"), this.graph.m_ManSprite.SetTexture("UDMinchoPro_0", this.m_LoadQueue.GetObject("UDMinchoPro_0") as Texture2D)); this.m_LoadQueue.Remove("UDMinchoPro.fnt"); this.m_LoadQueue.Remove("UDMinchoPro_0.png"); } // Token: 0x060008A2 RID: 2210 RVA: 0x000266F8 File Offset: 0x000248F8 public static void AutoSave() { if (App.IsInit) { SaveLoadManager.SaveSystem(); GameObject gameObject = GameObject.Find("SceneAdvMode"); if (gameObject != null) { EventWnd component = gameObject.GetComponent(); if (component != null && component.Mode == PLAY_MODE.NORMAL && !component.Player.RestoreOn) { SaveLoadManager.SaveAuto(); Qoo.Debug.Print("Auto Save"); } } } } // Token: 0x060008A3 RID: 2211 RVA: 0x00026770 File Offset: 0x00024970 public static int GetOSVersion() { return 0; } // Token: 0x060008A4 RID: 2212 RVA: 0x00026774 File Offset: 0x00024974 public static void CleanMemory() { Resources.UnloadUnusedAssets(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); } // Token: 0x170000F6 RID: 246 // (get) Token: 0x060008A5 RID: 2213 RVA: 0x0002678C File Offset: 0x0002498C public static UnityApp PlatformApp { get { return Singleton.Instance; } } // Token: 0x170000F7 RID: 247 // (get) Token: 0x060008A6 RID: 2214 RVA: 0x00026794 File Offset: 0x00024994 public static ManSound Sound { get { return Singleton.Instance.sound; } } // Token: 0x170000F8 RID: 248 // (get) Token: 0x060008A7 RID: 2215 RVA: 0x000267A0 File Offset: 0x000249A0 public static UnityGraph Graph { get { return Singleton.Instance.graph; } } // Token: 0x170000F9 RID: 249 // (get) Token: 0x060008A8 RID: 2216 RVA: 0x000267AC File Offset: 0x000249AC public static Man2D Sprite { get { return Singleton.Instance.graph.m_ManSprite; } } // Token: 0x170000FA RID: 250 // (get) Token: 0x060008A9 RID: 2217 RVA: 0x000267C0 File Offset: 0x000249C0 public static TaskManager Task { get { return Singleton.Instance.task; } } // Token: 0x170000FB RID: 251 // (get) Token: 0x060008AA RID: 2218 RVA: 0x000267CC File Offset: 0x000249CC public static UnityFileLoader File { get { return Singleton.Instance.file; } } // Token: 0x170000FC RID: 252 // (get) Token: 0x060008AB RID: 2219 RVA: 0x000267D8 File Offset: 0x000249D8 public static GameInput Input { get { return Singleton.Instance.input; } } // Token: 0x0400076B RID: 1899 private TaskManager task; // Token: 0x0400076C RID: 1900 private UnityFileLoader file; // Token: 0x0400076D RID: 1901 private UnityTimer time; // Token: 0x0400076E RID: 1902 private UnityGraph graph; // Token: 0x0400076F RID: 1903 private ManSound sound; // Token: 0x04000770 RID: 1904 private GameInput input; // Token: 0x04000771 RID: 1905 private UnityFileLoaderQueue m_LoadQueue = new UnityFileLoaderQueue(); // Token: 0x04000772 RID: 1906 public string InitScene; // Token: 0x04000773 RID: 1907 public string InitDebugScene; // Token: 0x04000774 RID: 1908 private bool m_isInit; //internal bool isJapanese; internal LocaleEnum locale = LocaleEnum.Japanese; internal FontEnum font = FontEnum.NewRodin; internal int preferredFontSize = 28; }