public static void GoAsset() { LoadingJobData jobData = new LoadingJobData(); List <AssetBundleData> assetBundles = new List <AssetBundleData> (); assetBundles.Add(new AssetBundleData("hellgatemaster", "asset", typeof(TextAsset))); jobData.assetBundles = assetBundles; jobData.finishedDelegate = delegate(List <object> obj, LoadingJobController job) { TextAsset text = Util.GetListObject <TextAsset> (obj); HellgateAssetData data = JsonUtil.FromJson <HellgateAssetData> (text.text); assetBundles = new List <AssetBundleData> (); for (int i = 0; i < data._Sprite.Length; i++) { assetBundles.Add(new AssetBundleData("hellgateasset", data._Sprite [i], typeof(Sprite))); } for (int i = 0; i < data.Prefab.Length; i++) { assetBundles.Add(new AssetBundleData("hellgateasset", data.Prefab [i])); } job.PutExtra("title", "AssetBundle"); job.nextSceneName = "HellgateAsset"; job.LoadAssetBundle(assetBundles); }; SceneManager.Instance.LoadingJob(jobData); }
public static void GoMain() { string[] sprites = new string[] { "DarkGrey_Box128x128Measured", "DarkGrey_TrimmedBox128x128", "DarkGrey_Angle128x128", "LightGrey_Box128x128Measured", "LightGrey_TrimmedBox128x128", "LightGrey_Angle128x128", "Orange_Box128x128Measured", "Orange_TrimmedBox128x128", "Orange_Angle128x128" }; LoadingJobData jobData = new LoadingJobData("HellgateMain"); List <AssetBundleData> assetBundles = new List <AssetBundleData> (); for (int i = 0; i < sprites.Length; i++) { AssetBundleData aBD = new AssetBundleData("hellgatemain"); aBD.type = typeof(Sprite); aBD.objName = sprites [i]; assetBundles.Add(aBD); } jobData.assetBundles = assetBundles; jobData.PutExtra("title", "Main"); SceneManager.Instance.LoadingJob(jobData); }
public static void GoQuest() { LoadingJobData jobData = new LoadingJobData(); List <AssetBundleData> assetBundles = new List <AssetBundleData> (); assetBundles.Add(new AssetBundleData("hellgatemaster", "quest", typeof(TextAsset))); jobData.finishedDelegate = delegate(List <object> obj, LoadingJobController job) { TextAsset text = Util.GetListObject <TextAsset> (obj); HellgateQuestDataEx data = JsonUtil.FromJson <HellgateQuestDataEx> (text.text); assetBundles = new List <AssetBundleData> (); assetBundles.Add(new AssetBundleData("hellgatequest", data._User.Prefab)); for (int i = 0; i < data._Missile.Count; i++) { assetBundles.Add(new AssetBundleData("hellgatequest", data._Missile [i].Prefab)); } job.PutExtra("data", data); job.nextSceneName = "HellgateQuest"; job.LoadAssetBundle(assetBundles); }; jobData.assetBundles = assetBundles; jobData.status = MainMenuStatus.Destroy; jobData.assetBundleAllUnload = true; SceneManager.Instance.LoadingJob(jobData, false); }
public static void GoDatabase() { LoadingJobData jobData = new LoadingJobData("HellgateDatabase"); jobData.PutExtra("title", "Database"); SceneManager.Instance.LoadingJob(jobData); }
public void OnClickScreen2() { LoadingJobData jobData = new LoadingJobData("HellgateScreen2"); jobData.PutExtra("title", "Screen2"); SceneManager.Instance.LoadingJob(jobData); }
public static void GoNotification() { LoadingJobData jobData = new LoadingJobData("HellgateNotification"); jobData.PutExtra("title", "Notification\nPlease Mobile test."); SceneManager.Instance.LoadingJob(jobData); }
public void OnClickScreen1() { LoadingJobData jobData = new LoadingJobData("HellgateScreen1"); jobData.status = MainMenuStatus.Hide; jobData.PutExtra("title", "Screen1"); SceneManager.Instance.LoadingJob(jobData, false); }
public void OnClickPopUp1() { LoadingJobData jobData = new LoadingJobData("HellgatePopUp1"); jobData.PutExtra("label", "PopUp Test\nAlpha = 0"); jobData.nextScenePopUp = true; jobData.shieldAlpha = 0; SceneManager.Instance.LoadingJob(jobData); }
public static void GoHttp() { List <HttpData> https = new List <HttpData> (); https.Add(new HttpData("info", "json")); LoadingJobData data = new LoadingJobData(); data.https = https; data.finishedDelegate = delegate(List <object> obj, LoadingJobController job) { #if UNITY_5_4_OR_NEWER UnityEngine.Networking.UnityWebRequest www = Util.GetListObject <UnityEngine.Networking.UnityWebRequest> (obj); HellgateHttpData sprites = JsonUtil.FromJson <HellgateHttpData> (www.downloadHandler.text); #else WWW www = Util.GetListObject <WWW> (obj); HellgateHttpData sprites = JsonUtil.FromJson <HellgateHttpData> (www.text); #endif List <AssetBundleData> assetbundles = new List <AssetBundleData> (); for (int i = 0; i < sprites._Sprite.Length; i++) { assetbundles.Add(new AssetBundleData("hellgatehttp", sprites._Sprite [i], typeof(Sprite))); } job.nextSceneName = "HellgateHttp"; job.LoadAssetBundle(assetbundles); }; data.lEvent = delegate(LoadingJobStatus status, LoadingJobController job) { if (status == LoadingJobStatus.HttpTimeover) // Time over. { SceneManager.Instance.Close(); SceneManager.Instance.PopUp("Replay ?", PopUpType.YesAndNo, delegate(PopUpYNType type) { if (type == PopUpYNType.Yes) { SceneManager.Instance.LoadingJob(data); } }); } else if (status == LoadingJobStatus.HttpError) { SceneManager.Instance.Close(); SceneManager.Instance.PopUp("Network Error.", PopUpType.Ok, delegate(PopUpYNType type) { SceneManager.Instance.Reboot(); }); } }; data.PutExtra("title", "Http"); SceneManager.Instance.LoadingJob(data); }
public void OnClickSound() { string[] sounds = new string[] { "bgm2", "sound1", "sound2" }; List <AssetBundleData> assetBundles = new List <AssetBundleData> (); for (int i = 0; i < sounds.Length; i++) { AssetBundleData aBD = new AssetBundleData("hellgatesound"); aBD.type = typeof(AudioClip); aBD.objName = sounds [i]; assetBundles.Add(aBD); } LoadingJobData jobData = new LoadingJobData(); jobData.assetBundles = assetBundles; jobData.finishedDelegate = delegate(List <object> obj, LoadingJobController job) { List <AudioClip> clips = obj.GetListObjects <AudioClip> (); for (int i = 0; i < clips.Count; i++) { if (clips [i].name == "bgm2") { SoundManager.Instance.AddBGM(clips [i]); } else { SoundManager.Instance.AddSound(clips [i]); } } SoundManager.Instance.PlayBGM("bgm2"); SceneManager.Instance.Close(delegate() { SceneManager.Instance.PopUp("The bgm and menu sound has been set.", PopUpType.Ok); }); }; SceneManager.Instance.LoadingJob(jobData); }