public IEnumerator LoadResources()
 {
     if (string.IsNullOrEmpty(m_eventGuid))
     {
         yield break;
     }
     while (!AudioManager.isReady)
     {
         if (AssetManagerError.op_Implicit(AudioManager.error) != 0)
         {
             yield break;
         }
         yield return(null);
     }
     if (AudioManager.TryGetDefaultBankName(m_eventGuid, 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}", 84, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioEventPlayableAsset.cs");
         }
         else
         {
             m_loadedResources = true;
         }
     }
     else
     {
         Log.Warning("Could not find a bank to load for event '" + m_eventGuid + "'.", 92, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioEventPlayableAsset.cs");
     }
 }
Example #2
0
        private void CancelInternal()
        {
            //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_0013: 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)
            //IL_0029: Unknown result type (might be due to invalid IL or missing references)
            //IL_002e: Unknown result type (might be due to invalid IL or missing references)
            //IL_003b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0043: Unknown result type (might be due to invalid IL or missing references)
            //IL_005e: Unknown result type (might be due to invalid IL or missing references)
            //IL_008f: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
            EventInstance musicEventInstance = this.musicEventInstance;

            if (musicEventInstance.isValid())
            {
                musicEventInstance.stop(1);
                musicEventInstance.release();
                musicEventInstance.clearHandle();
            }
            EventInstance ambianceEventInstance = this.ambianceEventInstance;

            if (ambianceEventInstance.isValid())
            {
                ambianceEventInstance.stop(1);
                ambianceEventInstance.release();
                ambianceEventInstance.clearHandle();
            }
            if (m_musicBankLoadRequest != null)
            {
                if (AssetManagerError.op_Implicit(m_musicBankLoadRequest.error) == 0)
                {
                    AudioManager.UnloadBank(m_musicBankLoadRequest.bankName);
                }
                m_musicBankLoadRequest = null;
            }
            if (m_ambianceBankLoadRequest != null)
            {
                if (AssetManagerError.op_Implicit(m_ambianceBankLoadRequest.error) == 0)
                {
                    AudioManager.UnloadBank(m_ambianceBankLoadRequest.bankName);
                }
                m_ambianceBankLoadRequest = null;
            }
            error = AssetManagerError.op_Implicit(50);
            state = State.Error;
        }
Example #3
0
 private void UnloadInternal()
 {
     //IL_000e: 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)
     if (m_musicBankLoadRequest != null)
     {
         if (AssetManagerError.op_Implicit(m_musicBankLoadRequest.error) == 0)
         {
             AudioManager.UnloadBank(m_musicBankLoadRequest.bankName);
         }
         m_musicBankLoadRequest = null;
     }
     if (m_ambianceBankLoadRequest != null)
     {
         if (AssetManagerError.op_Implicit(m_ambianceBankLoadRequest.error) == 0)
         {
             AudioManager.UnloadBank(m_ambianceBankLoadRequest.bankName);
         }
         m_ambianceBankLoadRequest = null;
     }
     s_instances.Remove(this);
 }
Example #4
0
        internal AudioWorldMusicRequest(AudioReferenceWithParameters music, AudioReferenceWithParameters ambiance, [CanBeNull] AudioContext context, bool playAutomatically)
            : this()
        {
            //IL_0002: Unknown result type (might be due to invalid IL or missing references)
            //IL_0007: Unknown result type (might be due to invalid IL or missing references)
            //IL_0013: Unknown result type (might be due to invalid IL or missing references)
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            //IL_001a: 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)
            //IL_0060: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
            this.music     = music;
            this.ambiance  = ambiance;
            this.context   = context;
            m_pendingState = (playAutomatically ? PendingStateChange.Play : PendingStateChange.None);
            Guid eventGuid  = music.get_eventGuid();
            Guid eventGuid2 = ambiance.get_eventGuid();

            if (!AssetManager.get_isReady())
            {
                Log.Error("Tried to load a world music but the AudioManager isn't ready.", 85, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                Fail(AssetManagerError.op_Implicit(60));
                return;
            }
            string bankName;

            if (eventGuid != Guid.Empty)
            {
                if (!AudioManager.TryGetDefaultBankName(eventGuid, out bankName))
                {
                    Log.Warning($"Could not get default bank name for requested world music with guid {eventGuid}.", 95, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(AssetManagerError.op_Implicit(10));
                    return;
                }
            }
            else
            {
                bankName = string.Empty;
            }
            string bankName2;

            if (eventGuid2 != Guid.Empty)
            {
                if (!AudioManager.TryGetDefaultBankName(eventGuid2, out bankName2))
                {
                    Log.Warning($"Could not get default bank name for requested world ambiance with guid {eventGuid}.", 110, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(AssetManagerError.op_Implicit(10));
                    return;
                }
            }
            else
            {
                bankName2 = string.Empty;
            }
            if (bankName.Length > 0)
            {
                m_musicBankLoadRequest = AudioManager.LoadBankAsync(bankName);
            }
            if (bankName2.Length > 0 && !bankName.Equals(bankName2))
            {
                m_ambianceBankLoadRequest = AudioManager.LoadBankAsync(bankName2);
            }
            state = State.Loading;
            s_instances.Add(this);
            UpdateInternal();
        }