コード例 #1
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);
            }
        }
コード例 #2
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;
        }
コード例 #3
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);
        }
コード例 #4
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);
        }
コード例 #5
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;
        }
コード例 #6
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;
        }
コード例 #7
0
        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());
                        }
                    }
                }
            }
        }
コード例 #8
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());
                }
            }
        }
コード例 #9
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;
        }
コード例 #10
0
        public IEnumerator LoadResources()
        {
            switch (m_resourceLoadingState)
            {
            case ResourceLoadingState.Loaded:
                break;

            case ResourceLoadingState.Loading:
                do
                {
                    yield return(null);
                }while (m_resourceLoadingState == ResourceLoadingState.Loading);
                break;

            default:
                throw new ArgumentOutOfRangeException();

            case ResourceLoadingState.None:
            {
                if (!FightSpellEffectFactory.isReady)
                {
                    break;
                }
                m_resourceLoadingState = ResourceLoadingState.Loading;
                int spellEffectReferenceCount = m_spellEffectData.Count;
                int count = ((Dictionary <SpellEffectKey, AssetReference>)m_spellEffectOverrideReferences).Count;
                int num   = spellEffectReferenceCount + count;
                AssetLoadRequest <SpellEffect>[] loadRequests = new AssetLoadRequest <SpellEffect> [num];
                IEnumerator[] spellEffectLoadRequests         = new IEnumerator[num];
                int           i;
                for (i = 0; i < spellEffectReferenceCount; i++)
                {
                    string spellEffect = m_spellEffectData[i].spellEffect;
                    if (spellEffect.Length > 0)
                    {
                        loadRequests[i] = AssetManager.LoadAssetAsync <SpellEffect>(spellEffect, "core/spells/effects");
                        continue;
                    }
                    Log.Warning($"Spell named '{this.get_displayName()}' has an unassigned spell effect at index {i}.", 118, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Spells\\SpellDefinition.cs");
                    loadRequests[i] = null;
                }
                foreach (AssetReference value in ((Dictionary <SpellEffectKey, AssetReference>)m_spellEffectOverrideReferences).Values)
                {
                    AssetReference current = value;
                    if (current.get_hasValue())
                    {
                        loadRequests[i] = current.LoadFromAssetBundleAsync <SpellEffect>("core/spells/effects");
                    }
                    else
                    {
                        loadRequests[i] = null;
                    }
                    i++;
                }
                yield return(EnumeratorUtility.ParallelRecursiveSafeExecution((IEnumerator[])loadRequests));

                SpellEffect[] spellEffects = new SpellEffect[spellEffectReferenceCount];
                for (i = 0; i < spellEffectReferenceCount; i++)
                {
                    AssetLoadRequest <SpellEffect> val = loadRequests[i];
                    if (val == null)
                    {
                        spellEffects[i] = null;
                        continue;
                    }
                    if (AssetManagerError.op_Implicit(val.get_error()) == 0)
                    {
                        spellEffectLoadRequests[i] = (spellEffects[i] = val.get_asset()).Load();
                        continue;
                    }
                    spellEffects[i] = null;
                    Log.Error($"Could not load spell effect for spell {this.get_name()}: {val.get_error()}", 159, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Spells\\SpellDefinition.cs");
                }
                Dictionary <SpellEffectKey, SpellEffect> spellEffectOverrides = new Dictionary <SpellEffectKey, SpellEffect>(((Dictionary <SpellEffectKey, AssetReference>)m_spellEffectOverrideReferences).Count, SpellEffectKeyComparer.instance);
                foreach (SpellEffectKey key in ((Dictionary <SpellEffectKey, AssetReference>)m_spellEffectOverrideReferences).Keys)
                {
                    AssetLoadRequest <SpellEffect> val2 = loadRequests[i];
                    if (val2 == null)
                    {
                        spellEffectOverrides.Add(key, null);
                    }
                    else if (AssetManagerError.op_Implicit(val2.get_error()) == 0)
                    {
                        SpellEffect asset = val2.get_asset();
                        spellEffectOverrides.Add(key, asset);
                        spellEffectLoadRequests[i] = asset.Load();
                    }
                    else
                    {
                        spellEffectOverrides.Add(key, null);
                        Log.Error($"Could not load spell effect override for key {key} for spell {this.get_name()}: {val2.get_error()}", 183, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Spells\\SpellDefinition.cs");
                    }
                    i++;
                }
                yield return(EnumeratorUtility.ParallelRecursiveImmediateSafeExecution(spellEffectLoadRequests));

                m_spellEffects         = spellEffects;
                m_spellEffectOverrides = spellEffectOverrides;
                m_resourceLoadingState = ResourceLoadingState.Loaded;
                FightSpellEffectFactory.NotifySpellDefinitionLoaded(this);
                break;
            }
            }
        }
コード例 #11
0
        private bool Update()
        {
            //IL_001b: 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_0077: Unknown result type (might be due to invalid IL or missing references)
            //IL_008a: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00de: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_010c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0117: Unknown result type (might be due to invalid IL or missing references)
            //IL_011c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0120: Unknown result type (might be due to invalid IL or missing references)
            //IL_0127: Unknown result type (might be due to invalid IL or missing references)
            //IL_012c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0137: Unknown result type (might be due to invalid IL or missing references)
            //IL_0151: Expected I4, but got Unknown
            //IL_017d: Unknown result type (might be due to invalid IL or missing references)
            //IL_019f: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a4: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01dd: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ef: 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_0204: Expected I4, but got Unknown
            //IL_022d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0232: Unknown result type (might be due to invalid IL or missing references)
            //IL_0236: Unknown result type (might be due to invalid IL or missing references)
            //IL_0292: Unknown result type (might be due to invalid IL or missing references)
            //IL_029d: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_02ad: Unknown result type (might be due to invalid IL or missing references)
            //IL_02b2: Unknown result type (might be due to invalid IL or missing references)
            if (m_bundleLoadRequest != null)
            {
                if (!m_bundleLoadRequest.get_isDone())
                {
                    return(false);
                }
                if (AssetManagerError.op_Implicit(m_bundleLoadRequest.get_error()) != 0)
                {
                    error = m_bundleLoadRequest.get_error();
                    return(true);
                }
                m_bundleLoadRequest = null;
                m_assetLoadRequest  = m_assetReference.LoadFromAssetBundleAsync <TextAsset>(bundleName);
            }
            if (m_assetLoadRequest != null)
            {
                if (!m_assetLoadRequest.get_isDone())
                {
                    return(false);
                }
                if (AssetManagerError.op_Implicit(m_assetLoadRequest.get_error()) != 0)
                {
                    error = m_assetLoadRequest.get_error();
                    return(true);
                }
                TextAsset asset = m_assetLoadRequest.get_asset();
                m_assetLoadRequest = null;
                System studioSystem = AudioManager.studioSystem;
                Bank   bank         = default(Bank);
                studioSystem.loadBankMemoryPoint(asset.get_bytes(), 1, ref bank);
                this.bank = bank;
            }
            Bank          bank2        = this.bank;
            LOADING_STATE val          = default(LOADING_STATE);
            RESULT        loadingState = bank2.getLoadingState(ref val);

            if ((int)loadingState != 0)
            {
                Log.Error($"Failed to retrieve loading state for bank named '{bankName}' loaded from bundle named '{bundleName}': {loadingState}.", 121, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                error = AssetManagerError.op_Implicit(30);
                bank2 = this.bank;
                bank2.unload();
                bank2 = this.bank;
                bank2.clearHandle();
                return(true);
            }
            switch ((int)val)
            {
            case 0:
            case 1:
                Log.Error("Bank named '" + bankName + "' is being either unloaded or being unloaded instead of being loaded.", 132, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                error = AssetManagerError.op_Implicit(30);
                return(true);

            case 2:
                return(false);

            case 3:
                if (loadSamples)
                {
                    if (!m_loadingSamples)
                    {
                        bank2 = this.bank;
                        if ((int)bank2.loadSampleData() != 0)
                        {
                            Log.Warning("Could not load samples for bank named '" + bankName + "'.", 147, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                            return(true);
                        }
                        m_loadingSamples = true;
                    }
                    bank2 = this.bank;
                    LOADING_STATE val2 = default(LOADING_STATE);
                    if ((int)bank2.getSampleLoadingState(ref val2) == 0)
                    {
                        switch (val2 - 2)
                        {
                        case 0:
                            return(false);

                        case 2:
                            Log.Error("Failed to load samples for bank named '" + bankName + "'.", 165, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                            bank2 = this.bank;
                            bank2.unloadSampleData();
                            break;
                        }
                    }
                    else
                    {
                        Log.Warning("Could not get sample loading state for bank named '" + bankName + "'.", 172, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                    }
                    m_loadingSamples = false;
                }
                return(true);

            case 4:
                Log.Error("Failed to load bank named '" + bankName + "'.", 180, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioBankLoadRequest.cs");
                error = AssetManagerError.op_Implicit(30);
                bank2 = this.bank;
                bank2.unload();
                bank2 = this.bank;
                bank2.clearHandle();
                return(true);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }