public void AnimateInNewHeroSkin(Actor actor)
    {
        GameObject       gameObject = actor.gameObject;
        AnimatedHeroSkin skin       = new AnimatedHeroSkin {
            Actor            = actor,
            GameObject       = gameObject,
            OriginalScale    = gameObject.transform.localScale,
            OriginalPosition = gameObject.transform.position
        };

        this.m_animData = skin;
        gameObject.transform.position   = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y + 0.5f, gameObject.transform.position.z);
        gameObject.transform.localScale = this.m_heroSkinContainer.transform.lossyScale;
        object[] args = new object[] {
            "from", 0f, "to", 1f, "time", 0.6f, "easetype", iTween.EaseType.easeOutCubic, "onupdate", "AnimateNewHeroSkinUpdate", "onupdatetarget", base.gameObject, "oncomplete", "AnimateNewHeroSkinFinished", "oncompleteparams", skin,
            "oncompletetarget", base.gameObject
        };
        Hashtable hashtable = iTween.Hash(args);

        iTween.ValueTo(gameObject, hashtable);
        CollectionHeroSkin component = actor.gameObject.GetComponent <CollectionHeroSkin>();

        if (component != null)
        {
            component.ShowSocketFX();
        }
    }
    private void ShowSocketFX()
    {
        CollectionHeroSkin component = this.m_heroSkinObject.GetComponent <CollectionHeroSkin>();

        if (component != null)
        {
            component.ShowSocketFX();
        }
    }
示例#3
0
    public void UpdateVisual(bool isOverDeck)
    {
        Actor     activeActor = this.m_activeActor;
        SpellType nONE        = SpellType.NONE;

        if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARDS)
        {
            if ((isOverDeck && (this.m_entityDef != null)) && !this.m_entityDef.IsHero())
            {
                this.m_activeActor = this.m_deckTile;
                nONE = SpellType.SUMMON_IN;
            }
            else
            {
                this.m_activeActor = this.m_cardActor;
                nONE = SpellType.DEATHREVERSE;
            }
        }
        else
        {
            this.m_activeActor = this.m_cardActor;
            nONE = SpellType.DEATHREVERSE;
        }
        if (activeActor != this.m_activeActor)
        {
            if (activeActor != null)
            {
                activeActor.Hide();
                activeActor.gameObject.SetActive(false);
            }
            if (this.m_activeActor != null)
            {
                this.m_activeActor.gameObject.SetActive(true);
                this.m_activeActor.Show();
                if ((this.m_visualType == CollectionManagerDisplay.ViewMode.CARD_BACKS) && (this.m_currentCardBack != null))
                {
                    CardBackManager.Get().UpdateCardBack(this.m_activeActor, this.m_currentCardBack);
                }
                Spell spell = this.m_activeActor.GetSpell(nONE);
                if (spell != null)
                {
                    spell.ActivateState(SpellStateType.BIRTH);
                }
                if ((this.m_entityDef != null) && this.m_entityDef.IsHero())
                {
                    CollectionHeroSkin component = this.m_activeActor.gameObject.GetComponent <CollectionHeroSkin>();
                    component.SetClass(this.m_entityDef.GetClass());
                    component.ShowSocketFX();
                }
            }
        }
    }
 public void UpdateHeroSkinNames(CollectionManagerDisplay.ViewMode mode)
 {
     if ((UniversalInputManager.UsePhoneUI != null) && (mode == CollectionManagerDisplay.ViewMode.HERO_SKINS))
     {
         foreach (CollectionCardVisual visual in this.m_collectionCardVisuals)
         {
             if (visual.IsShown())
             {
                 CollectionHeroSkin component = visual.GetActor().GetComponent <CollectionHeroSkin>();
                 if (component != null)
                 {
                     component.ShowCollectionManagerText();
                 }
             }
         }
     }
 }
    public void UpdateFavoriteHeroSkins(CollectionManagerDisplay.ViewMode mode, bool isMassDisenchanting)
    {
        bool flag = mode == CollectionManagerDisplay.ViewMode.HERO_SKINS;

        if (this.m_heroSkinsDecor != null)
        {
            this.m_heroSkinsDecor.SetActive(flag && !isMassDisenchanting);
        }
        if (flag)
        {
            bool flag2 = CollectionManager.Get().GetTaggedDeck(CollectionManager.DeckTag.Editing) == null;
            foreach (CollectionCardVisual visual in this.m_collectionCardVisuals)
            {
                if (visual.IsShown())
                {
                    Actor actor = visual.GetActor();
                    CollectionHeroSkin component = actor.GetComponent <CollectionHeroSkin>();
                    if (component != null)
                    {
                        component.ShowShadow(actor.IsShown());
                        EntityDef entityDef = actor.GetEntityDef();
                        if (entityDef != null)
                        {
                            component.SetClass(entityDef.GetClass());
                            bool show = false;
                            if (flag2)
                            {
                                NetCache.CardDefinition favoriteHero = CollectionManager.Get().GetFavoriteHero(entityDef.GetClass());
                                if (favoriteHero != null)
                                {
                                    show = ((CollectionManager.Get().GetBestHeroesIOwn(entityDef.GetClass()).Count > 1) && !string.IsNullOrEmpty(favoriteHero.Name)) && (favoriteHero.Name == entityDef.GetCardId());
                                }
                            }
                            component.ShowFavoriteBanner(show);
                        }
                    }
                }
            }
        }
    }