/// <summary> /// Facilitates user settable/gettable AudioClip.loadState /// </summary> public static void SetAudioClipLoadState(AudioClip audioClip, AudioDataLoadState newLoadState) { if (audioClip != null) { audioClipToLoadState[audioClip] = newLoadState; } }
internal void Play(IntroloopAudio music, bool isFade) { if (music == null) { throw new IntroloopException("Played IntroloopAudio is null!"); } pauseDspTimestamp = 0; pauseDspTotal = 0; twoSources[0].pitch = music.Pitch; twoSources[1].pitch = music.Pitch; AudioDataLoadState loadState = music.audioClip.loadState; string musicName = music.audioClip.name; FadeVolume = isFade ? 0 : 1; if (loadState != AudioDataLoadState.Loaded) { IntroloopLog("\"" + musicName + "\" not loaded yet. Loading into memory..."); StartCoroutine(LoadAndPlayRoutine(music)); } else { IntroloopLog("\"" + musicName + "\" already loaded in memory."); SetupPlayingSchedule(music); } }
private bool CheckIfAllStorySoundsLoaded() { if (_storySounds == null) { return(false); } bool alldone = true; for (int i = 0; i < _storySounds.Length; i++) { if (_storySounds[i] == null) { alldone = false; break; } AudioDataLoadState res = _storySounds[i].loadState; if (res != AudioDataLoadState.Loaded) { alldone = false; msg.text = "waiting to load sound " + i.ToString(); break; } } return(alldone); }
public bool CheckIfAllSoundsLoaded() { if (instructionClips == null) { return(false); } bool alldone = true; for (int i = 0; i < instructionClips.Length; i++) { if (instructionClips[i] == null) { //Debug.Log("clip " + i.ToString() + "is null"); alldone = false; break; } AudioDataLoadState res = instructionClips[i].loadState; if (res != AudioDataLoadState.Loaded) { //Debug.Log("clip " + i.ToString() + "is not loaded"); alldone = false; break; } } if (alldone) { Debug.Log("Load Instruction Sound time" + (Time.realtimeSinceStartup - soundST).ToString()); } return(alldone); }
private bool CheckIfAllSoundsLoaded() { if (_memorySounds == null) { return(false); } bool alldone = true; for (int i = 0; i < _memorySounds.Length; i++) { if (_memorySounds[i] == null) { alldone = false; break; } AudioDataLoadState res = _memorySounds[i].loadState; if (res != AudioDataLoadState.Loaded) { alldone = false; msg.text = "waiting to load sound " + i.ToString(); break; } } //if (alldone) // Debug.Log("LoadMemorySound time" + (Time.realtimeSinceStartup - soundST).ToString()); return(alldone); }
public static AudioDataLoadState GetAudioClipLoadState(AudioClip audioClip) { AudioDataLoadState value = AudioDataLoadState.Failed; if (audioClip != null) { value = audioClip.loadState; audioLoadState.TryGetValue(audioClip, out value); } return(value); }
public static AudioDataLoadState GetAudioClipLoadState(AudioClip audioClip) { AudioDataLoadState result = AudioDataLoadState.Failed; if (audioClip != null) { result = audioClip.loadState; audioLoadState.TryGetValue(audioClip, out result); } return(result); }
public static AudioDataLoadState GetAudioClipLoadState(AudioClip audioClip) { AudioDataLoadState result = AudioDataLoadState.Failed; if ((UnityEngine.Object)audioClip != (UnityEngine.Object)null) { result = audioClip.loadState; Manager.audioLoadState.TryGetValue(audioClip, out result); } return(result); }
/// <summary> /// Facilitates user settable/gettable AudioClip.loadState /// </summary> /// <returns>AudioDataLoadState.Failed if audioClip is null or audioClip.loadState if this manager did not touch the audioClip</returns> public static AudioDataLoadState GetAudioClipLoadState(AudioClip audioClip) { AudioDataLoadState ret = AudioDataLoadState.Failed; #if UNITY_4 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 // audioLoadState.TryGetValue(audioClip, out ret); // TODO: fix #else if (audioClip != null) { ret = audioClip.loadState; audioClipToLoadState.TryGetValue(audioClip, out ret); } #endif return(ret); }
private static int get_loadState(IntPtr L) { object obj = null; int result; try { obj = ToLua.ToObject(L, 1); AudioClip audioClip = (AudioClip)obj; AudioDataLoadState loadState = audioClip.get_loadState(); ToLua.Push(L, loadState); result = 1; } catch (Exception ex) { result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.get_Message() : "attempt to index loadState on a nil value"); } return(result); }
internal void Play(IntroloopAudio music, bool isFade) { pauseDspTimestamp = 0; pauseDspTotal = 0; AudioDataLoadState loadState = music.audioClip.loadState; string musicName = music.audioClip.name; FadeVolume = isFade ? 0 : 1; if (loadState != AudioDataLoadState.Loaded) { IntroloopLogger.Log("\"" + musicName + "\" not loaded yet. Loading into memory..."); StartCoroutine(LoadAndPlayRoutine(music)); } else { IntroloopLogger.Log("\"" + musicName + "\" already loaded in memory."); SetupPlayingSchedule(music); } }
public bool AreStoryResourcesReady() { if (StoryNextImage == null) { return(false); } else if (StoryNextMask == null) { return(false); } else if (StoryNextSound == null) { return(false); } else { AudioDataLoadState res = StoryNextSound.loadState; return(res == AudioDataLoadState.Loaded); } }
public static void SetAudioClipLoadState(AudioClip audioClip, AudioDataLoadState newLoadState) { audioLoadState[audioClip] = newLoadState; }