public IEnumerator LoadImage(string filepath) { var popup = PopupLoading.Creat(); yield return(new WaitForEndOfFrame()); //WWW www = new WWW ("file://" + filepath); WWW www = new WWW(ConfigUtility.fileLoadPath(filepath)); yield return(www); Destroy(popup); yield return(new WaitForEndOfFrame()); try { if (ConfigUtility.isSupportedTextureType(Path.GetExtension(filepath))) { editor.gameScreen.setBackgroundImage(www.texture); } else { editor.debugLog.LogWarning(ExceptionList.openFileError.Value); yield break; } } catch { editor.debugLog.LogWarning(ExceptionList.openFileError.Value); yield break; } editor.getTrackMap.header.BackgroundFileFullName = filepath; editor.debugLog.Log(MessageList.openFileSuccess.Value); }
public void CloseLoadingPopup() { if (popupLoading != null) { popupLoading.Close(); popupLoading = null; } }
public void ShowLoadingPopup(string localizeKey = null, bool showDim = true) { if (popupLoading == null) { GameObject tempGameObject = NGUITools.AddChild(root, Resources.Load(Global.POPUP_PATH + "/PopupLoading", typeof(GameObject)) as GameObject); tempGameObject.name = "PopupLoading"; popupLoading = tempGameObject.GetComponent <PopupLoading>(); popupLoading.Open(localizeKey, showDim); } else { popupLoading.SetLoadingText(localizeKey); } }
public static async Task PopLoading(bool popAll = true) { if (_popupLoading == null) { return; } _popupLoading = null; if (popAll) { await PopupNavigation.PopAllAsync(); } else { await PopupNavigation.PopAsync(); } }
public IEnumerator LoadAudioCilp(string filepath) { var popup = PopupLoading.Creat(); yield return(new WaitForEndOfFrame()); WWW www = new WWW(ConfigUtility.fileLoadPath(filepath)); yield return(www); Destroy(popup); yield return(new WaitForEndOfFrame()); try { if (Path.GetExtension(filepath).ToLower() == ".mp3" && Application.platform != RuntimePlatform.Android) { var clip = NAudioPlayer.FromMp3Data(www.bytes); clip.name = Path.GetFileNameWithoutExtension(filepath); editor.audioPlayer.SetClip(clip); } else if (Path.GetExtension(filepath).ToLower() == ".wav" || (Path.GetExtension(filepath).ToLower() == ".mp3" && Application.platform == RuntimePlatform.Android)) { var clip = www.audioClip; clip.name = Path.GetFileNameWithoutExtension(filepath); editor.audioPlayer.SetClip(clip); } else { editor.debugLog.LogWarning(ExceptionList.openFileError.Value); yield break; } } catch (Exception e) { editor.debugLog.LogWarning(ExceptionList.openFileError.Value); yield break; } editor.getTrackMap.header.AudioFileFullName = filepath; editor.debugLog.Log(MessageList.openFileSuccess.Value); }
public PopupLoadingCommand(PopupLoading instance, string message, string title) { popupLoading = instance; popupLoading.Init(message, title); }
public void CloseLoadingPopup() { if (popupLoading != null) { popupLoading.Close(); popupLoading = null; } }
public void ShowLoadingPopup(string localizeKey = null, bool showDim = true) { if (popupLoading == null) { GameObject tempGameObject = NGUITools.AddChild(root, Resources.Load(Global.POPUP_PATH + "/PopupLoading", typeof(GameObject)) as GameObject); tempGameObject.name = "PopupLoading"; popupLoading = tempGameObject.GetComponent<PopupLoading>(); popupLoading.Open(localizeKey, showDim); } else { popupLoading.SetLoadingText(localizeKey); } }
public static async Task ShowLoading() { _popupLoading = new PopupLoading(); await PopupNavigation.PushAsync(_popupLoading); }