protected IEnumerator Load(params AudioReferenceWithParameters[] audioReferences) { int num = audioReferences.Length; int bankCount = 0; if (num == 0) { m_initializationState = InitializationState.Loaded; yield break; } string[] array = new string[num]; for (int i = 0; i < num; i++) { AudioReferenceWithParameters val = audioReferences[i]; if (!val.get_isValid() || !AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(val), out string bankName)) { continue; } int num2 = 0; while (true) { if (num2 < bankCount) { if (bankName.Equals(array[num2])) { break; } num2++; continue; } array[bankCount] = bankName; int num3 = bankCount + 1; bankCount = num3; break; } } if (bankCount == 0) { m_initializationState = InitializationState.Error; yield break; } AudioBankLoadRequest[] bankLoadRequests = new AudioBankLoadRequest[bankCount]; for (int j = 0; j < bankCount; j++) { bankLoadRequests[j] = AudioManager.LoadBankAsync(array[j]); } m_bankLoadRequests = bankLoadRequests; m_initializationState = InitializationState.Loading; yield return(EnumeratorUtility.ParallelRecursiveImmediateSafeExecution((IEnumerator[])bankLoadRequests)); for (int k = 0; k < bankCount; k++) { if (AssetManagerError.op_Implicit(bankLoadRequests[k].error) == 0) { m_initializationState = InitializationState.Loaded; yield break; } } m_initializationState = InitializationState.Error; }
protected override IEnumerator LoadInternal() { if (m_sound.get_isValid()) { if (AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(m_sound), out string bankName)) { AudioBankLoadRequest bankLoadRequest = AudioManager.LoadBankAsync(bankName); while (!bankLoadRequest.isDone) { yield return(null); } if (AssetManagerError.op_Implicit(bankLoadRequest.error) == 0) { m_loadedAudioBank = true; } else { Log.Warning("Could not load bank named '" + bankName + "' for sound of visual character effect named '" + this.get_name() + "'.", 52, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\VisualSpellEffect.cs"); } } else { Log.Warning("Could not get default bank name for sound of visual effect named '" + this.get_name() + "'.", 57, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\VisualSpellEffect.cs"); } } m_initializationState = InitializationState.Loaded; }
public IEnumerator LoadResources() { if (null == m_parameters) { yield break; } AudioReferenceWithParameters sound = m_parameters.sound; if (!sound.get_isValid()) { yield break; } while (!AudioManager.isReady) { if (AssetManagerError.op_Implicit(AudioManager.error) != 0) { yield break; } yield return(null); } if (AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(sound), out string bankName)) { AudioBankLoadRequest bankLoadRequest = AudioManager.LoadBankAsync(bankName); while (!bankLoadRequest.isDone) { yield return(null); } if (AssetManagerError.op_Implicit(bankLoadRequest.error) != 0) { Log.Error($"Failed to load bank named '{bankName}': {bankLoadRequest.error}", 80, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\CellObjectAnimationPlayableAsset.cs"); } else { m_loadedResources = true; } } else { Log.Warning("Could not find a bank to load sound for cell object animation parameters named '" + m_parameters.get_name() + "'.", 88, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\CellObjectAnimationPlayableAsset.cs"); } }
protected IEnumerator Load(AudioReferenceWithParameters audioReference) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(audioReference), out string bankName)) { m_initializationState = InitializationState.Error; yield break; } AudioBankLoadRequest bankLoadRequest = AudioManager.LoadBankAsync(bankName); m_bankLoadRequests = new AudioBankLoadRequest[1] { bankLoadRequest }; m_initializationState = InitializationState.Loading; while (!bankLoadRequest.isDone) { yield return(null); } m_initializationState = ((AssetManagerError.op_Implicit(bankLoadRequest.error) == 0) ? InitializationState.Loaded : InitializationState.Error); }
protected override void UnloadInternal() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (m_sound.get_isValid() && m_loadedAudioBank && AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(m_sound), out string bankName)) { AudioManager.UnloadBank(bankName); m_loadedAudioBank = false; } m_initializationState = InitializationState.None; }
protected override void UnloadInternal() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) AudioReferenceWithParameters spawnSound = m_spawnSound; if (spawnSound.get_isValid() && m_loadedSpawnEffectAudioBank && AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(spawnSound), out string bankName)) { AudioManager.UnloadBank(bankName); m_loadedSpawnEffectAudioBank = false; } if (m_spellEffectOverrides != null) { foreach (SpellEffect value in ((Dictionary <SpellEffectKey, SpellEffect>)m_spellEffectOverrides).Values) { value.Unload(); } } m_initializationState = InitializationState.None; }
protected override void UnloadInternal() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) AudioReferenceWithParameters sound = m_mainEffect.sound; if (sound.get_isValid() && m_loadedMainEffectAudioBank && AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(sound), out string bankName)) { AudioManager.UnloadBank(bankName); m_loadedMainEffectAudioBank = false; } AudioReferenceWithParameters sound2 = m_stopEffect.sound; if (sound2.get_isValid() && m_loadedStopEffectAudioBank && AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(sound2), out string bankName2)) { AudioManager.UnloadBank(bankName2); m_loadedStopEffectAudioBank = false; } m_initializationState = InitializationState.None; }
public void UnloadResources() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (m_loadedResources && AudioManager.isReady && AudioManager.TryGetDefaultBankName(AudioReferenceWithParameters.op_Implicit(m_parameters.sound), out string bankName)) { AudioManager.UnloadBank(bankName); } }