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;
 }
Example #2
0
 protected virtual void Awake()
 {
     //IL_0010: Unknown result type (might be due to invalid IL or missing references)
     if (m_sound.get_isValid())
     {
         AudioManager.StartCoroutine(Load(m_sound));
     }
 }
Example #3
0
 private void Awake()
 {
     //IL_000e: Unknown result type (might be due to invalid IL or missing references)
     if (m_music.get_isValid())
     {
         AudioManager.StartCoroutine(AudioManager.StartUIMusic(m_music));
     }
 }
        public override void OnBehaviourPlay(Playable playable, FrameData info)
        {
            //IL_0015: 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_002c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            //IL_003a: 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_005b: Unknown result type (might be due to invalid IL or missing references)
            //IL_007b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0087: Unknown result type (might be due to invalid IL or missing references)
            if (null == m_fightMap)
            {
                return;
            }
            AudioReferenceWithParameters sound = m_parameters.sound;

            if (sound.get_isValid())
            {
                AbstractFightMap fightMap = m_fightMap;
                Vector2Int       origin   = m_origin;
                int x = origin.get_x();
                origin = m_origin;
                if (AudioManager.TryCreateInstance(transform: (!fightMap.TryGetCellObject(x, origin.get_y(), out CellObject cellObject)) ? null : cellObject.get_transform(), audioReference: sound, eventInstance: out m_eventInstance))
                {
                    m_eventInstance.setParameterValue("Strength", m_strength);
                    m_eventInstance.start();
                }
                else
                {
                    Log.Warning("Failed to create event instance for cell object animation parameters named '" + m_parameters.get_name() + "'.", 109, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\CellObjectAnimationPlayableBehaviour.cs");
                }
            }
Example #5
0
        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;
        }
Example #6
0
        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 OnPointerDown(PointerEventData eventData)
 {
     //IL_000f: Unknown result type (might be due to invalid IL or missing references)
     if (m_soundOnDragStart.get_isValid())
     {
         AudioManager.PlayOneShot(m_soundOnDragStart, this.get_transform());
     }
 }
Example #8
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     //IL_0038: Unknown result type (might be due to invalid IL or missing references)
     if (m_soundOnOver.get_isValid() && !(null == m_toggle) && m_toggle.get_interactable() && !m_toggle.get_isOn())
     {
         AudioManager.PlayOneShot(m_soundOnOver, this.get_transform());
     }
 }
Example #9
0
 private void OnValueChanged(bool arg0)
 {
     //IL_000f: Unknown result type (might be due to invalid IL or missing references)
     if (m_soundOnClick.get_isValid())
     {
         AudioManager.PlayOneShot(m_soundOnClick, this.get_transform());
     }
 }
Example #10
0
 public void OnPointerClick(PointerEventData eventData)
 {
     //IL_002b: Unknown result type (might be due to invalid IL or missing references)
     if (!(null == m_selectable) && m_selectable.get_interactable() && m_soundOnClick.get_isValid())
     {
         AudioManager.PlayOneShot(m_soundOnClick, this.get_transform());
     }
 }
Example #11
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     //IL_0040: Unknown result type (might be due to invalid IL or missing references)
     //IL_005f: Unknown result type (might be due to invalid IL or missing references)
     if (m_soundOnOver.get_isValid() && !(null == m_button) && m_button.get_interactable() && (m_eventInstance.isValid() || (AudioManager.isReady && AudioManager.TryCreateInstance(m_soundOnOver, this.get_transform(), out m_eventInstance))))
     {
         m_eventInstance.start();
     }
 }
 public void OnPointerUp(PointerEventData eventData)
 {
     //IL_0022: Unknown result type (might be due to invalid IL or missing references)
     //IL_0027: 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)
     if (m_soundOnDragEnd.get_isValid())
     {
         if (m_dragEventInstance.isValid())
         {
             m_dragEventInstance.stop(m_stopMode);
         }
         AudioManager.PlayOneShot(m_soundOnDragEnd, this.get_transform());
     }
 }
Example #13
0
        public VisualEffect InstantiateMainEffect([NotNull] Transform parent, [CanBeNull] ITimelineContextProvider contextProvider)
        {
            //IL_003e: 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_0049: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_004f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0054: Unknown result type (might be due to invalid IL or missing references)
            //IL_006d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0072: Unknown result type (might be due to invalid IL or missing references)
            //IL_0074: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            //IL_0084: Unknown result type (might be due to invalid IL or missing references)
            //IL_008d: Unknown result type (might be due to invalid IL or missing references)
            //IL_008e: 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)
            EffectData   mainEffect   = m_mainEffect;
            VisualEffect visualEffect = mainEffect.visualEffect;

            if (null == visualEffect)
            {
                Log.Warning("Tried to instantiate attachable effect named '" + this.get_name() + "' without a visual effect setup.", 163, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\AttachableEffect.cs");
                return(null);
            }
            Vector3       position = parent.get_position() + mainEffect.positionOffset;
            Quaternion    rotation = Quaternion.get_identity();
            CameraHandler current  = CameraHandler.current;

            if (null != current)
            {
                rotation = current.mapRotation.GetInverseRotation();
            }
            AudioReferenceWithParameters sound = mainEffect.sound;

            if (sound.get_isValid())
            {
                AudioManager.PlayOneShot(sound, parent);
            }
            VisualEffect visualEffect2 = VisualEffectFactory.Instantiate(visualEffect, position, rotation, Vector3.get_one(), parent);

            visualEffect2.destructionOverride = OnMainEffectInstanceDestructionRequest;
            return(visualEffect2);
        }
Example #14
0
        public VisualEffect InstantiateStopEffect([NotNull] Transform parent, [CanBeNull] ITimelineContextProvider contextProvider)
        {
            //IL_001a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Unknown result type (might be due to invalid IL or missing references)
            //IL_002a: Unknown result type (might be due to invalid IL or missing references)
            //IL_002b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Unknown result type (might be due to invalid IL or missing references)
            //IL_0049: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0050: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: 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_0069: Unknown result type (might be due to invalid IL or missing references)
            //IL_006a: Unknown result type (might be due to invalid IL or missing references)
            //IL_006b: Unknown result type (might be due to invalid IL or missing references)
            EffectData   stopEffect   = m_stopEffect;
            VisualEffect visualEffect = stopEffect.visualEffect;

            if (null == visualEffect)
            {
                return(null);
            }
            Vector3       position = parent.get_position() + stopEffect.positionOffset;
            Quaternion    rotation = Quaternion.get_identity();
            CameraHandler current  = CameraHandler.current;

            if (null != current)
            {
                rotation = current.mapRotation.GetInverseRotation();
            }
            AudioReferenceWithParameters sound = stopEffect.sound;

            if (sound.get_isValid())
            {
                AudioManager.PlayOneShot(sound, parent);
            }
            VisualEffect visualEffect2 = VisualEffectFactory.Instantiate(visualEffect, position, rotation, Vector3.get_one(), parent);

            visualEffect2.destructionOverride = OnStopEffectInstanceDestructionRequest;
            return(visualEffect2);
        }
Example #15
0
        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");
            }
        }
Example #16
0
        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;
        }
Example #17
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();
            }
        }