示例#1
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();
        }
示例#2
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);
        }
示例#3
0
        private IEnumerator LoadPlayerVisual(WeaponDefinition definition)
        {
            AssetReference illustrationReference = definition.GetIllustrationReference();

            m_VisualLoader.Setup(illustrationReference, AssetBundlesUtility.GetUICharacterResourcesBundleName());
            while (m_VisualLoader.loadState == UIResourceLoadState.Loading)
            {
                yield return(null);
            }
        }
        private void UpdateIllustration()
        {
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_005e: Unknown result type (might be due to invalid IL or missing references)
            m_illustration.set_enabled(false);
            if (m_definition == null)
            {
                m_illustration.set_sprite(m_emptySprite);
                m_illustration.set_enabled(true);
                return;
            }
            AssetReference illustrationReference = m_definition.GetIllustrationReference();

            if (illustrationReference.get_hasValue())
            {
                Main.monoBehaviour.StartCoroutine(m_definition.LoadIllustrationAsync <Sprite>(AssetBundlesUtility.GetUICharacterResourcesBundleName(), illustrationReference, (Action <Sprite, string>)UpdateIllustrationCallback));
            }
        }
        private void SetIllustration(WeaponData data)
        {
            //IL_0017: Unknown result type (might be due to invalid IL or missing references)
            //IL_001c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            WeaponDefinition weaponDefinition = data?.definition;

            if (weaponDefinition != null)
            {
                AssetReference weaponIllustrationReference = weaponDefinition.GetWeaponIllustrationReference();
                if (weaponIllustrationReference.get_hasValue())
                {
                    Main.monoBehaviour.StartCoroutine(weaponDefinition.LoadIllustrationAsync <Sprite>(AssetBundlesUtility.GetUICharacterResourcesBundleName(), weaponIllustrationReference, (Action <Sprite, string>)SetIllustrationCallback));
                }
            }
            else if (m_weaponImage != null)
            {
                m_weaponImage.set_enabled(false);
            }
        }
 private void UpdateSprite()
 {
     //IL_0058: Unknown result type (might be due to invalid IL or missing references)
     if (!this.get_isActiveAndEnabled())
     {
         return;
     }
     if (m_weaponDefinition == null)
     {
         m_illu.set_sprite(null);
         return;
     }
     if (m_loadingCoroutine != null)
     {
         this.StopCoroutine(m_loadingCoroutine);
         m_illu.set_sprite(null);
     }
     m_loadingCoroutine = this.StartCoroutine(m_weaponDefinition.LoadIllustrationAsync <Sprite>(AssetBundlesUtility.GetUICharacterResourcesBundleName(), m_weaponDefinition.GetIllustrationReference(), (Action <Sprite, string>)UpdateSpriteCallback));
 }
示例#7
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);
        }
示例#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 LoadIllu(WeaponDefinition weaponDefinition)
 {
     m_illuImageLoader.Setup(weaponDefinition.GetIllustrationReference(), AssetBundlesUtility.GetUICharacterResourcesBundleName());
     yield break;
 }