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");
     }
 }
Exemplo n.º 2
0
        protected override IEnumerator Load()
        {
            string bundleName = AssetBundlesUtility.GetUICharacterResourcesBundleName();
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading bundle '{bundleName}' error={bundleLoadRequest.get_error()}", 26, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\PlayerUI\\PlayerUIMainState.cs");
                yield break;
            }
            UILoader <PlayerIconRoot> loader = new UILoader <PlayerIconRoot>(this, "PlayerLayerUI", "core/scenes/ui/player", disableOnLoad: true);

            yield return(loader.Load());

            m_ui = loader.ui;
            yield return(m_ui.LoadAssets());

            m_ui.get_gameObject().SetActive(true);
            m_ui.Initialise(this);
            m_ui.LoadVisual();
        }
Exemplo n.º 3
0
        public static IEnumerator LoadIllustrationAsync <T>(this EditableData definition, string bundleName, AssetReference assetReference, Action <T, string> onLoaded) where T : Object
        {
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading bundle '{bundleName}' for {((object)definition).GetType().Name} {definition.get_name()} error={bundleLoadRequest.get_error()}", 36, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Definitions\\ICastableDefinition.cs");
                onLoaded?.Invoke(default(T), null);
                yield break;
            }
            AssetLoadRequest <T> assetLoadRequest = assetReference.LoadFromAssetBundleAsync <T>(bundleName);

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading illustration for {((object)definition).GetType().Name} {definition.get_name()} error={assetLoadRequest.get_error()}", 50, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Definitions\\ICastableDefinition.cs");
                onLoaded?.Invoke(default(T), bundleName);
            }
            else
            {
                onLoaded?.Invoke(assetLoadRequest.get_asset(), bundleName);
            }
        }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 public IEnumerator Initialize()
 {
     if (null == m_prefab)
     {
         yield break;
     }
     m_prefabPool = new GameObjectPool(m_prefab, 8);
     if (!m_appearanceSound.get_isValid() || !AudioManager.isReady)
     {
         yield break;
     }
     if (AudioManager.TryGetDefaultBankName(m_appearanceSound, 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}", 105, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Maps\\MonsterSpawnCellDefinition.cs");
         }
         else
         {
             m_loadedAudioBank = true;
         }
     }
     else
     {
         Log.Warning($"Could not find a bank to load for event '{m_appearanceSound}'.", 113, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Maps\\MonsterSpawnCellDefinition.cs");
     }
 }
Exemplo n.º 6
0
        protected void Unload()
        {
            //IL_0035: Unknown result type (might be due to invalid IL or missing references)
            if (!AudioManager.isReady)
            {
                return;
            }
            AudioBankLoadRequest[] bankLoadRequests = m_bankLoadRequests;
            if (bankLoadRequests == null)
            {
                return;
            }
            int num = bankLoadRequests.Length;

            for (int i = 0; i < num; i++)
            {
                AudioBankLoadRequest audioBankLoadRequest = m_bankLoadRequests[i];
                if (!audioBankLoadRequest.isDone)
                {
                    audioBankLoadRequest.Cancel();
                }
                else if (AssetManagerError.op_Implicit(audioBankLoadRequest.error) == 0)
                {
                    AudioManager.UnloadBank(audioBankLoadRequest.bankName);
                }
            }
            m_bankLoadRequests = null;
        }
Exemplo n.º 7
0
        protected override IEnumerator Load()
        {
            m_modifications = new WeaponAndDeckModifications();
            m_modifications.Setup();
            this.LoadAssetBundle(AssetBundlesUtility.GetUIAnimatedCharacterResourcesBundleName());
            this.LoadAssetBundle("core/ui/characters/companions");
            string bundleName = AssetBundlesUtility.GetUICharacterResourcesBundleName();
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading bundle '{bundleName}' error={bundleLoadRequest.get_error()}", 48, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\PlayerUI\\DeckMainState.cs");
                yield break;
            }
            UILoader <DeckUIRoot> loader = new UILoader <DeckUIRoot>(this, "PlayerLayer_DeckCanvas", "core/scenes/ui/deck", disableOnLoad: true);

            yield return(loader.Load());

            m_ui = loader.ui;
            yield return(m_ui.LoadAssets());

            m_ui.get_gameObject().SetActive(true);
            m_ui.Initialise(m_modifications);
        }
Exemplo n.º 8
0
        private IEnumerator Load(string guid, string bundleName, UIResourceDisplayMode displayMode)
        {
            loadState = UIResourceLoadState.Loading;
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                loadState           = UIResourceLoadState.Error;
                m_pendingBundleName = string.Empty;
                if (m_resourceConsumer != null)
                {
                    m_resourceConsumer.UnRegister(this);
                    m_resourceConsumer = null;
                }
                Log.Error($"Could not load bundle named '{bundleName}': {bundleLoadRequest.get_error()}", 226, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Components\\UIResourceLoader.cs");
                m_coroutine = null;
                yield break;
            }
            AssetLoadRequest <T> assetLoadRequest = AssetManager.LoadAssetAsync <T>(guid, bundleName);

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                AssetManager.UnloadAssetBundle(bundleName);
                loadState           = UIResourceLoadState.Error;
                m_pendingBundleName = string.Empty;
                if (m_resourceConsumer != null)
                {
                    m_resourceConsumer.UnRegister(this);
                    m_resourceConsumer = null;
                }
                Log.Error($"Could not load asset with guid {guid} from bundle named '{bundleName}': {assetLoadRequest.get_error()}", 253, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Components\\UIResourceLoader.cs");
                m_coroutine = null;
                yield break;
            }
            T asset = assetLoadRequest.get_asset();

            yield return(Apply(asset, displayMode));

            if (m_loadedBundleName.Length != 0)
            {
                AssetManager.UnloadAssetBundle(m_loadedBundleName);
            }
            loadState           = UIResourceLoadState.Loaded;
            m_pendingBundleName = string.Empty;
            m_loadedBundleName  = bundleName;
            if (m_resourceConsumer != null)
            {
                m_resourceConsumer.UnRegister(this);
                m_resourceConsumer = null;
            }
            m_coroutine = null;
        }
Exemplo n.º 9
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;
        }
Exemplo n.º 10
0
        protected override IEnumerator LoadAssets()
        {
            AssetReference            weaponIllustrationReference = m_definition.GetWeaponIllustrationReference();
            AssetLoadRequest <Sprite> assetReferenceRequest       = weaponIllustrationReference.LoadFromAssetBundleAsync <Sprite>(AssetBundlesUtility.GetUICharacterResourcesBundleName());

            while (!assetReferenceRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading illustration for {((object)m_definition).GetType().Name} {m_definition.get_name()} error={assetReferenceRequest.get_error()}", 47, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Player\\DeckRoot\\WeaponRibbonItem.cs");
                yield break;
            }
            m_visual.set_sprite(assetReferenceRequest.get_asset());
            AssetReference uIWeaponButtonReference = m_definition.GetUIWeaponButtonReference();
            AssetLoadRequest <Material> matAssetReferenceRequest = uIWeaponButtonReference.LoadFromAssetBundleAsync <Material>("core/ui/characters/heroes");

            while (!matAssetReferenceRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(matAssetReferenceRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading material {0} error={1}", "core/ui/characters/weaponbutton", assetReferenceRequest.get_error()), 63, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Player\\DeckRoot\\WeaponRibbonItem.cs");
                yield break;
            }
            m_equipedMaterial = matAssetReferenceRequest.get_asset();
            m_shine.set_color(m_definition.deckBuildingWeaponShine);
        }
Exemplo n.º 11
0
        public IEnumerator LoadSceneAndBundleRequest(string sceneName, string bundleName, LoadSceneMode mode = 1, Action <SceneLoadRequest> completed = null)
        {
            //IL_001c: 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)
            AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            AssetManagerError error;

            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                error = bundleLoadRequest.get_error();
                Log.Error(((object)error).ToString(), 112, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\LoadSceneStateContext.cs");
                yield break;
            }
            LoadSceneParameters val = default(LoadSceneParameters);

            val._002Ector(mode);
            SceneLoadRequest sceneLoadRequest = this.LoadScene(sceneName, bundleName, val, true, completed);

            while (!sceneLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(sceneLoadRequest.get_error()) != 0)
            {
                error = sceneLoadRequest.get_error();
                Log.Error(((object)error).ToString(), 126, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\LoadSceneStateContext.cs");
            }
        }
Exemplo n.º 12
0
        private static IEnumerator GoToInitializationFailedState(InitializationFailure cause)
        {
            Log.Error("Switching to initialization failed state.", 280, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Main.cs");
            yield return(AudioManager.Unload());

            yield return(RuntimeData.Unload());

            if (AssetManagerError.op_Implicit(RuntimeData.error) != 0)
            {
                yield return(GoToCatastrophicFailureState(InitializationFailure.RuntimeDataLoad));

                yield break;
            }
            yield return(ApplicationStarter.ConfigureLocalAssetManager());

            if (!AssetManager.get_isReady())
            {
                yield return(GoToCatastrophicFailureState(cause));

                yield break;
            }
            yield return(AudioManager.Load());

            yield return(RuntimeData.LoadOffline());

            InitializationFailedState initializationFailedState = new InitializationFailedState(cause);

            StateManager.GetDefaultLayer().GetChainEnd().SetChildState(initializationFailedState, 0);
        }
Exemplo n.º 13
0
        public IEnumerator ChangeAnimatedCharacterData(int skinId, Gender gender)
        {
            if (!RuntimeData.characterSkinDefinitions.TryGetValue(skinId, out CharacterSkinDefinition characterSkinDefinition))
            {
                Log.Error($"Could not find character skin definition with id {skinId}.", 211, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                yield break;
            }
            BundleCategory         bundleCategory    = characterSkinDefinition.bundleCategory;
            string                 bundleName        = AssetBundlesUtility.GetAnimatedCharacterDataBundle(bundleCategory);
            AssetBundleLoadRequest bundleLoadRequest = AssetManager.LoadAssetBundle(bundleName);

            m_activeCharacterDataBundleCategory = bundleCategory;
            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Failed to load asset bundle named '{bundleName}' for character skin {characterSkinDefinition.get_displayName()} ({characterSkinDefinition.get_id()}): {bundleLoadRequest.get_error()}", 230, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                yield break;
            }
            AssetReference animatedCharacterDataReference = characterSkinDefinition.GetAnimatedCharacterDataReference(gender);
            AssetLoadRequest <AnimatedCharacterData> animatedCharacterDataLoadRequest = animatedCharacterDataReference.LoadFromAssetBundleAsync <AnimatedCharacterData>(bundleName);

            while (!animatedCharacterDataLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(animatedCharacterDataLoadRequest.get_error()) != 0)
            {
                AssetManager.UnloadAssetBundle(bundleName);
                m_activeCharacterDataBundleCategory = BundleCategory.None;
                Log.Error(string.Format("Failed to load requested {0} asset from bundle '{1}' for character skin {2} ({3}): {4}", "AnimatedCharacterData", bundleName, characterSkinDefinition.get_displayName(), characterSkinDefinition.get_id(), animatedCharacterDataLoadRequest.get_error()), 247, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
                yield break;
            }
            AnimatedCharacterData newAnimatedCharacterData = animatedCharacterDataLoadRequest.get_asset();

            yield return(newAnimatedCharacterData.LoadTimelineResources());

            AnimatedCharacterData animatedCharacterData = GetAnimatedCharacterData();

            if (null != animatedCharacterData)
            {
                string animatedCharacterDataBundle = AssetBundlesUtility.GetAnimatedCharacterDataBundle(m_animatedCharacterDataBundleCategory);
                animatedCharacterData.UnloadTimelineResources();
                AssetManager.UnloadAssetBundle(animatedCharacterDataBundle);
                m_animatedCharacterDataBundleCategory = BundleCategory.None;
            }
            SetAnimatedCharacterData(newAnimatedCharacterData);
            m_animatedCharacterDataBundleCategory = m_activeCharacterDataBundleCategory;
            m_activeCharacterDataBundleCategory   = BundleCategory.None;
            IAnimator2D animator       = GetAnimator();
            int         animationFrame = animator.get_currentFrame();

            yield return(SetAnimatorDefinition());

            animator.set_currentFrame(animationFrame);
        }
Exemplo n.º 14
0
        public IEnumerator LoadResources()
        {
            if (!m_prefabReference.get_hasValue())
            {
                yield break;
            }
            GameObject asset;

            if (string.IsNullOrEmpty(m_assetBundleName))
            {
                AssetReferenceRequest <GameObject> assetReferenceRequest2 = m_prefabReference.LoadFromResourcesAsync <GameObject>();
                while (!assetReferenceRequest2.get_isDone())
                {
                    yield return(null);
                }
                asset = assetReferenceRequest2.get_asset();
            }
            else
            {
                AssetBundleLoadRequest bundleRequest = AssetManager.LoadAssetBundle(m_assetBundleName);
                while (!bundleRequest.get_isDone())
                {
                    yield return(null);
                }
                if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
                {
                    Log.Error($"Could not load bundle named '{m_assetBundleName}': {bundleRequest.get_error()}", 99, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                    yield break;
                }
                m_loadedAssetBundle = true;
                AssetLoadRequest <GameObject> assetReferenceRequest = m_prefabReference.LoadFromAssetBundleAsync <GameObject>(m_assetBundleName);
                while (!assetReferenceRequest.get_isDone())
                {
                    yield return(null);
                }
                if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
                {
                    Log.Error($"Could not load requested asset ({m_prefabReference.get_value()}) from bundle named '{m_assetBundleName}': {assetReferenceRequest.get_error()}", 113, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                    yield break;
                }
                asset = assetReferenceRequest.get_asset();
            }
            VisualEffect component = asset.GetComponent <VisualEffect>();

            if (null == component)
            {
                Log.Error("Could not use prefab because it doesn't have a VisualEffect component.", 123, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\VisualEffectPlayableAsset.cs");
                yield break;
            }
            VisualEffectFactory.PreparePool(asset);
            m_prefab = component;
        }
Exemplo n.º 15
0
        private IEnumerator LoadCharacterSkin()
        {
            if (!string.IsNullOrEmpty(m_lastLoadedCharacterBundle))
            {
                this.UnloadAssetBundle(m_lastLoadedCharacterBundle, true, true);
                m_lastLoadedCharacterBundle = null;
            }
            PlayerData instance = PlayerData.instance;
            Gender     gender   = instance.gender;
            Id <CharacterSkinDefinition> skin = instance.Skin;

            if (skin == null || !RuntimeData.characterSkinDefinitions.TryGetValue(skin.value, out CharacterSkinDefinition characterSkinDefinition))
            {
                yield break;
            }
            BundleCategory         bundleCategory    = characterSkinDefinition.bundleCategory;
            string                 bundleName        = m_lastLoadedCharacterBundle = AssetBundlesUtility.GetAnimatedCharacterDataBundle(bundleCategory);
            AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                Log.Error($"Failed to load asset bundle named '{bundleName}' for character skin {characterSkinDefinition.get_displayName()} ({characterSkinDefinition.get_id()}): {bundleLoadRequest.get_error()}", 253, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            AssetReference animatedCharacterDataReference = characterSkinDefinition.GetAnimatedCharacterDataReference(gender);
            AssetLoadRequest <AnimatedCharacterData> animatedCharacterDataLoadRequest = animatedCharacterDataReference.LoadFromAssetBundleAsync <AnimatedCharacterData>(bundleName);

            while (!animatedCharacterDataLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(animatedCharacterDataLoadRequest.get_error()) != 0)
            {
                this.UnloadAssetBundle(bundleName, true, true);
                Log.Error(string.Format("Failed to load {0} asset from bundle '{1}' for character skin {2} ({3}): {4}", "AnimatedCharacterData", bundleName, characterSkinDefinition.get_displayName(), characterSkinDefinition.get_id(), animatedCharacterDataLoadRequest.get_error()), 269, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            AnimatedCharacterData animatedCharacterData = animatedCharacterDataLoadRequest.get_asset();

            yield return(animatedCharacterData.LoadTimelineResources());

            AnimatedFightCharacterData animatedFightCharacterData = animatedCharacterData as AnimatedFightCharacterData;
            AnimatedObjectDefinition   animatedObjectDefinition   = animatedFightCharacterData.animatedObjectDefinition;

            m_havreMap.character.SetCharacterData(animatedFightCharacterData, animatedObjectDefinition);
            m_loadCharacterCoroutine = null;
        }
Exemplo n.º 16
0
        protected IEnumerator LoadBundleRequest(string bundleName)
        {
            AssetBundleLoadRequest bundleLoadRequest = this.LoadAssetBundle(bundleName);

            while (!bundleLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleLoadRequest.get_error()) != 0)
            {
                AssetManagerError error = bundleLoadRequest.get_error();
                Log.Error(((object)error).ToString(), 97, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\LoadSceneStateContext.cs");
            }
        }
Exemplo n.º 17
0
        public static IEnumerator ConfigureLocalAssetManager()
        {
            AssetManager.UnloadAssetBundleManifest();
            AssetManager.SetAssetBundlesConfiguration(string.Empty, true);
            AssetBundleManifestLoadRequest loadOperation = AssetManager.LoadAssetBundleManifest(1, true);

            while (!loadOperation.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(loadOperation.get_error()) != 0)
            {
                Log.Error($"Could not load manifests data: {loadOperation.get_error()}.", 185, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs");
            }
        }
Exemplo n.º 18
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;
        }
Exemplo n.º 19
0
        public static IEnumerator ConfigureAssetManager(string serverUrl, bool patchAvailable)
        {
            AssetManager.UnloadAssetBundleManifest();
            AssetManager.SetAssetBundlesConfiguration(serverUrl, true);
            AssetBundleSource val = (!patchAvailable) ? 1 : 0;
            AssetBundleManifestLoadRequest loadOperation = AssetManager.LoadAssetBundleManifest(val, true);

            while (!loadOperation.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(loadOperation.get_error()) != 0)
            {
                Log.Error($"Could not load manifests data: {loadOperation.get_error()}.", 159, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs");
            }
        }
Exemplo n.º 20
0
        public static IEnumerator ReadBootConfig()
        {
            StreamingAssetLoadRequest loadOperation = AssetManager.LoadStreamingAssetAsync("application.json", 4096);

            while (!loadOperation.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(loadOperation.get_error()) != 0)
            {
                Log.Error($"Error while reading application.json: {loadOperation.get_error()}", 64, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Configuration\\ApplicationStarter.cs");
            }
            else
            {
                BootConfig.Read(new ConfigReader(loadOperation.get_text(), loadOperation.assetPath));
            }
        }
Exemplo n.º 21
0
 public void Cancel()
 {
     //IL_0026: 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_0040: Unknown result type (might be due to invalid IL or missing references)
     //IL_0045: Unknown result type (might be due to invalid IL or missing references)
     //IL_0048: 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: Invalid comparison between Unknown and I4
     //IL_0052: Unknown result type (might be due to invalid IL or missing references)
     //IL_0054: Invalid comparison between Unknown and I4
     //IL_0057: Unknown result type (might be due to invalid IL or missing references)
     //IL_005c: 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)
     //IL_0066: 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)
     //IL_0076: Unknown result type (might be due to invalid IL or missing references)
     if (m_bundleLoadRequest != null)
     {
         AssetManager.UnloadAssetBundle(bundleName);
         m_bundleLoadRequest = null;
     }
     else if (m_assetLoadRequest == null)
     {
         Bank          bank = this.bank;
         LOADING_STATE val  = default(LOADING_STATE);
         if ((int)bank.getLoadingState(ref val) == 0)
         {
             if (m_loadingSamples)
             {
                 bank = this.bank;
                 bank.unloadSampleData();
             }
             if ((int)val == 2 || (int)val == 3)
             {
                 bank = this.bank;
                 bank.unload();
                 bank = this.bank;
                 bank.clearHandle();
             }
         }
     }
     error  = AssetManagerError.op_Implicit(50);
     isDone = true;
 }
Exemplo n.º 22
0
        private IEnumerator LoadWeaponInfos(WeaponDefinition definition)
        {
            AssetReference weaponIllustrationReference = definition.GetWeaponIllustrationReference();

            m_weaponTextField.SetText(definition.i18nNameId);
            m_weaponLevelField.SetText(68066, new IndexedValueProvider(m_level.ToString()));
            AssetLoadRequest <Sprite> assetReferenceRequest = weaponIllustrationReference.LoadFromAssetBundleAsync <Sprite>(AssetBundlesUtility.GetUICharacterResourcesBundleName());

            while (!assetReferenceRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
            {
                Log.Error($"Error while loading illustration for {((object)definition).GetType().Name} {definition.get_name()} error={assetReferenceRequest.get_error()}", 305, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Player\\DeckRoot\\DeckUIRoot.cs");
                yield break;
            }
            WeaponData value = new WeaponData(definition, m_level);

            m_weaponVisual.SetValue(value);
            m_weaponPassiveText.SetText(definition.i18nDescriptionId, new FightValueProvider(definition, m_level));
            m_pedestalWeaponCellRenderer.SetValue(value);
            if (definition != null)
            {
                List <Id <SpellDefinition> > list = definition.spells.ToList();
                if (list.Count != 0 && RuntimeData.spellDefinitions.TryGetValue(list[0].value, out SpellDefinition value2))
                {
                    SpellData spellData = new SpellData(value2, m_level);
                    m_pedestalSpellCellRenderer.SetValue(spellData);
                    m_equippedFX.SetElement(value2.element);
                    m_spellRenderer.SetValue(new SpellData(value2, m_level));
                    string text = RuntimeData.FormattedText(spellData.definition.i18nNameId);
                    m_spellName.SetText(33557, new IndexedValueProvider(text));
                    m_spellDescription.SetText(spellData.definition.i18nDescriptionId, new FightValueProvider(spellData.definition, m_level));
                    int valueWithLevel  = definition.movementPoints.GetValueWithLevel(m_level);
                    int valueWithLevel2 = definition.life.GetValueWithLevel(m_level);
                    int valueWithLevel3 = definition.actionValue.GetValueWithLevel(m_level);
                    m_strengthField.SetText(valueWithLevel3.ToString());
                    m_lifeField.SetText(valueWithLevel2.ToString());
                    m_moveField.SetText(valueWithLevel.ToString());
                }
            }
        }
Exemplo n.º 23
0
        private IEnumerator LoadGod()
        {
            if (!string.IsNullOrEmpty(m_lastLoadedGodBundle))
            {
                this.UnloadAssetBundle(m_lastLoadedGodBundle, true, true);
                m_lastLoadedGodBundle = null;
            }
            God god = PlayerData.instance.god;

            if (!RuntimeData.godDefinitions.TryGetValue(god, out GodDefinition value))
            {
                yield break;
            }
            AssetReference         statuePrefabReference = value.statuePrefabReference;
            string                 bundleName            = m_lastLoadedGodBundle = AssetBundlesUtility.GetUIGodsResourcesBundleName();
            AssetBundleLoadRequest bundleRequest         = this.LoadAssetBundle(bundleName);

            while (!bundleRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
            {
                Log.Error($"Could not load bundle named '{bundleName}': {bundleRequest.get_error()}", 196, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            AssetLoadRequest <GameObject> assetReferenceRequest = statuePrefabReference.LoadFromAssetBundleAsync <GameObject>(bundleName);

            while (!assetReferenceRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetReferenceRequest.get_error()) != 0)
            {
                Log.Error($"Could not load requested asset ({statuePrefabReference.get_value()}) from bundle named '{bundleName}': {assetReferenceRequest.get_error()}", 208, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\HavreDimension\\HavreDimensionMainState.cs");
                yield break;
            }
            GameObject asset = assetReferenceRequest.get_asset();

            m_havreMap.godZaap.SetStatue(asset);
            m_loadGodCoroutine = null;
        }
Exemplo n.º 24
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");
            }
        }
Exemplo n.º 25
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);
 }
Exemplo n.º 26
0
        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);
        }
Exemplo n.º 27
0
        public static IEnumerator Load()
        {
            if (isReady)
            {
                Log.Error("Load called while the fight object factory is already ready.", 61, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                yield break;
            }
            AssetBundleLoadRequest bundleRequest = AssetManager.LoadAssetBundle("core/factories/fight_object_factory");

            while (!bundleRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(bundleRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading bundle: {0} error={1}", "core/factories/fight_object_factory", bundleRequest.get_error()), 74, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                yield break;
            }
            AllAssetsLoadRequest <FightObjectFactory> assetLoadRequest = AssetManager.LoadAllAssetsAsync <FightObjectFactory>("core/factories/fight_object_factory");

            while (!assetLoadRequest.get_isDone())
            {
                yield return(null);
            }
            if (AssetManagerError.op_Implicit(assetLoadRequest.get_error()) != 0)
            {
                Log.Error(string.Format("Error while loading asset: {0} error={1}", "FightObjectFactory", assetLoadRequest.get_error()), 85, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                yield break;
            }
            s_instance = assetLoadRequest.get_assets()[0];
            s_companionCharacterPool       = new GameObjectPool(s_instance.m_companionCharacterPrefab, 2);
            s_summoningCharacterPool       = new GameObjectPool(s_instance.m_summoningCharacterPrefab, 2);
            s_objectMechanismCharacterPool = new GameObjectPool(s_instance.m_objectMechanismPrefab, 2);
            s_floorMechanismCharacterPool  = new GameObjectPool(s_instance.m_floorMechanismPrefab, 2);
            s_animatedObjectEffectPool     = new GameObjectPool(s_instance.m_animatedObjectEffectPrefab, 2);
            s_timelineAssetEffectPool      = new GameObjectPool(s_instance.m_timelineAssetEffectPrefab, 4);
            s_valueChangedFeedbackPool     = new GameObjectPool(s_instance.m_valueChangedFeedbackPrefab, 4);
            isReady = true;
        }
        private static IEnumerator PreloadEffectAssets <K, V>(SerializableDictionaryLogic <K, AssetReference> effects, Dictionary <K, V> effectCache, string bundleName) where V : ScriptableEffect
        {
            int count = ((Dictionary <K, AssetReference>)effects).Count;

            if (count != 0)
            {
                AssetLoadRequest <V>[] loadRequests = new AssetLoadRequest <V> [count];
                int num = 0;
                foreach (AssetReference value in ((Dictionary <K, AssetReference>)effects).Values)
                {
                    AssetReference current = value;
                    if (current.get_hasValue())
                    {
                        loadRequests[num] = current.LoadFromAssetBundleAsync <V>(bundleName);
                    }
                    num++;
                }
                yield return(EnumeratorUtility.ParallelRecursiveImmediateExecution((IEnumerator[])loadRequests));

                num = 0;
                foreach (K key in ((Dictionary <K, AssetReference>)effects).Keys)
                {
                    AssetLoadRequest <V> val = loadRequests[num];
                    num++;
                    if (val != null)
                    {
                        if (AssetManagerError.op_Implicit(val.get_error()) != 0)
                        {
                            Log.Error($"Failed to load effect for '{key}': {val.get_error()}", 608, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs");
                        }
                        else
                        {
                            effectCache.Add(key, val.get_asset());
                        }
                    }
                }
            }
        }
Exemplo n.º 29
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();
            }
        }
Exemplo n.º 30
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();
        }