示例#1
0
        private IEnumerator DisplayWeaponEnumerator(WeaponDefinition definition)
        {
            if (!(m_currentWeapon == definition))
            {
                m_currentWeapon = definition;
                bool flag  = PlayerData.instance.weaponInventory.Contains(definition.get_id());
                bool flag2 = !IsCurrentWeapon(definition.get_id()) && flag;
                m_validateButton.set_interactable(flag2);
                m_validateButtonText.SetText(flag2 ? 40340 : 38149);
                PlayerData.instance.weaponInventory.TryGetLevel(m_currentWeapon.get_id(), out m_level);
                if (m_enterAnimationFinished)
                {
                    yield return(PlayFadeSequence(toOut: true));
                }
                yield return(LoadWeaponInfos(definition));

                BuildDeckList();
                m_backgroundShader.TweenColor(definition.deckBuildingBackgroundColor, definition.deckBuildingBackgroundColor2, 0.2f);
                AssetReference uIAnimatedCharacterReference = definition.GetUIAnimatedCharacterReference();
                CanvasGroup    characterGroup = m_characterloader.GetComponent <CanvasGroup>();
                characterGroup.set_alpha(0f);
                m_characterloader.Setup(uIAnimatedCharacterReference, AssetBundlesUtility.GetUIAnimatedCharacterResourcesBundleName());
                while (m_characterloader.loadState == UIResourceLoadState.Loading)
                {
                    yield return(null);
                }
                DOTweenModuleUI.DOFade(characterGroup, 1f, 0.3f);
                m_equippedFX.SetEquipped(IsCurrentWeapon(definition.get_id()));
                if (m_enterAnimationFinished)
                {
                    yield return(PlayFadeSequence(toOut: false));
                }
            }
        }
示例#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
        protected override IEnumerator Load()
        {
            AssetManager.LoadAssetBundle(AssetBundlesUtility.GetUIAnimatedCharacterResourcesBundleName());
            UILoader <UIZaapPVPLoading> loader = new UILoader <UIZaapPVPLoading>(this, "MatchmakingUI_1v1", "core/scenes/maps/havre_maps", disableOnLoad: true);

            yield return(loader.Load());

            m_ui = loader.ui;
            m_ui.onForceAiRequested       = OnForceAiRequested;
            m_ui.onCancelRequested        = OnCancelRequested;
            m_ui.onEnterAnimationFinished = OnPlayRequested;
            yield return(m_ui.LoadAssets());

            m_frame = new MatchMakingFrame
            {
                onGameCreated  = OnGameCreated,
                onGameCanceled = OnGameCancel,
                onGameError    = OnGameError
            };
        }