Beispiel #1
0
        private bool StartInstance()
        {
            //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_0070: Unknown result type (might be due to invalid IL or missing references)
            //IL_009d: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
            EventInstance eventInstance = m_eventInstance;

            if (!AudioManager.isReady)
            {
                Log.Warning($"Tried to create event instance with guid {m_eventGuid} but the audio manager is not ready.", 124, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioEventPlayableBehaviour.cs");
                return(false);
            }
            if (!AudioManager.TryCreateInstance(m_eventGuid, out eventInstance))
            {
                return(false);
            }
            if (m_parameters != null)
            {
                foreach (KeyValuePair <string, float> item in (Dictionary <string, float>)m_parameters)
                {
                    eventInstance.setParameterValue(item.Key, item.Value);
                }
            }
            if (m_audioContext != null)
            {
                m_audioContext.AddEventInstance(eventInstance);
            }
            else if (null != m_ownerTransform)
            {
                eventInstance.set3DAttributes(FMODUtility.To3DAttributes(m_ownerTransform));
            }
            eventInstance.start();
            m_eventInstance = eventInstance;
            return(true);
        }
Beispiel #2
0
        private void UpdateInternal()
        {
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
            //IL_0109: Unknown result type (might be due to invalid IL or missing references)
            //IL_010e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0119: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_013c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0141: Unknown result type (might be due to invalid IL or missing references)
            //IL_0144: Unknown result type (might be due to invalid IL or missing references)
            //IL_014b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0152: Unknown result type (might be due to invalid IL or missing references)
            //IL_0157: Unknown result type (might be due to invalid IL or missing references)
            //IL_0162: Unknown result type (might be due to invalid IL or missing references)
            //IL_017e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0185: Unknown result type (might be due to invalid IL or missing references)
            //IL_018a: Unknown result type (might be due to invalid IL or missing references)
            //IL_018d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0194: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01db: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fc: Invalid comparison between Unknown and I4
            //IL_0205: Unknown result type (might be due to invalid IL or missing references)
            //IL_021f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0226: Unknown result type (might be due to invalid IL or missing references)
            //IL_0229: Invalid comparison between Unknown and I4
            //IL_0232: Unknown result type (might be due to invalid IL or missing references)
            switch (state)
            {
            case State.None:
            case State.Loaded:
            case State.Playing:
            case State.Stopped:
            case State.Error:
                break;

            case State.Loading:
            {
                if ((m_musicBankLoadRequest != null && !m_musicBankLoadRequest.isDone) || (m_ambianceBankLoadRequest != null && !m_ambianceBankLoadRequest.isDone))
                {
                    break;
                }
                if (m_musicBankLoadRequest != null && AssetManagerError.op_Implicit(m_musicBankLoadRequest.error) != 0)
                {
                    Log.Warning("Could not load audio bank named '" + m_musicBankLoadRequest.bankName + "' for requested world music.", 149, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(m_musicBankLoadRequest.error);
                    break;
                }
                if (m_ambianceBankLoadRequest != null && AssetManagerError.op_Implicit(m_ambianceBankLoadRequest.error) != 0)
                {
                    Log.Warning("Could not load audio bank named '" + m_ambianceBankLoadRequest.bankName + "' for requested world ambiance.", 156, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(m_ambianceBankLoadRequest.error);
                    break;
                }
                AudioReferenceWithParameters val3 = music;
                if (val3.get_isValid() && AudioManager.TryCreateInstance(music, out EventInstance eventInstance))
                {
                    if (context != null)
                    {
                        context.AddEventInstance(eventInstance);
                    }
                    val3 = music;
                    val3.ApplyParameters(eventInstance);
                    this.musicEventInstance = eventInstance;
                }
                val3 = ambiance;
                if (val3.get_isValid() && AudioManager.TryCreateInstance(ambiance, out EventInstance eventInstance2))
                {
                    if (context != null)
                    {
                        context.AddEventInstance(eventInstance2);
                    }
                    val3 = ambiance;
                    val3.ApplyParameters(eventInstance2);
                    this.ambianceEventInstance = eventInstance2;
                }
                state = State.Loaded;
                switch (m_pendingState)
                {
                case PendingStateChange.None:
                    break;

                case PendingStateChange.Play:
                    StartInternal();
                    break;

                case PendingStateChange.Stop:
                    UnloadInternal();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                break;
            }

            case State.Stopping:
            {
                EventInstance musicEventInstance    = this.musicEventInstance;
                EventInstance ambianceEventInstance = this.ambianceEventInstance;
                bool          flag = false;
                if (musicEventInstance.isValid())
                {
                    PLAYBACK_STATE val = default(PLAYBACK_STATE);
                    if ((int)musicEventInstance.getPlaybackState(ref val) == 0 && (int)val != 2)
                    {
                        flag = true;
                    }
                    else
                    {
                        musicEventInstance.release();
                        musicEventInstance.clearHandle();
                    }
                }
                if (ambianceEventInstance.isValid())
                {
                    PLAYBACK_STATE val2 = default(PLAYBACK_STATE);
                    if ((int)ambianceEventInstance.getPlaybackState(ref val2) == 0 && (int)val2 != 2)
                    {
                        flag = true;
                    }
                    else
                    {
                        ambianceEventInstance.release();
                        ambianceEventInstance.clearHandle();
                    }
                }
                if (!flag)
                {
                    UnloadInternal();
                    state = State.Stopped;
                }
                break;
            }

            default:
                throw new ArgumentOutOfRangeException();
            }
        }