public void Initialize()
 {
     foreach (TAG_CARDTYPE tag_cardtype in this.ACTOR_CARD_TYPES)
     {
         IEnumerator enumerator = Enum.GetValues(typeof(TAG_PREMIUM)).GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 TAG_PREMIUM current             = (TAG_PREMIUM)((int)enumerator.Current);
                 string      heroSkinOrHandActor = ActorNames.GetHeroSkinOrHandActor(tag_cardtype, current);
                 ActorKey    callbackData        = this.MakeActorKey(tag_cardtype, current);
                 AssetLoader.Get().LoadActor(heroSkinOrHandActor, new AssetLoader.GameObjectCallback(this.OnActorLoaded), callbackData, false);
             }
         }
         finally
         {
             IDisposable disposable = enumerator as IDisposable;
             if (disposable == null)
             {
             }
             disposable.Dispose();
         }
     }
 }
Ejemplo n.º 2
0
    private void DoShowCardRewards(List <string> cardIds, Vector3?finalPosition, Vector3?origin, bool disableFullscreen)
    {
        int index = 0;
        int count = cardIds.Count;

        foreach (string str in cardIds)
        {
            FullDef    fullDef   = DefLoader.Get().GetFullDef(str, null);
            GameObject obj2      = AssetLoader.Get().LoadActor(ActorNames.GetHandActor(fullDef.GetEntityDef(), TAG_PREMIUM.NORMAL), false, false);
            Actor      component = obj2.GetComponent <Actor>();
            component.SetCardDef(fullDef.GetCardDef());
            component.SetEntityDef(fullDef.GetEntityDef());
            if (component.m_cardMesh != null)
            {
                BoxCollider collider = component.m_cardMesh.GetComponent <BoxCollider>();
                if (collider != null)
                {
                    collider.enabled = false;
                }
            }
            this.m_CurrentCardRewards.Add(component);
            GameUtils.SetParent(component, this.m_RewardsCardArea, false);
            this.ShowCardRewardsObject(obj2, finalPosition, origin, index, count);
            index++;
        }
        this.EnableFullscreen(disableFullscreen);
    }
    private void OnCardDefLoaded(string cardID, CardDef cardDef, object userData)
    {
        RDMDeckEntry      entry        = (RDMDeckEntry)userData;
        ActorLoadCallback callbackData = new ActorLoadCallback {
            choice  = entry,
            cardDef = cardDef
        };

        AssetLoader.Get().LoadActor(ActorNames.GetHandActor(entry.EntityDef, entry.Flair.Premium), new AssetLoader.GameObjectCallback(this.OnActorLoaded), callbackData, false);
    }
Ejemplo n.º 4
0
 public void LoadBigCardActor(bool andShowBigCard)
 {
     if (base.isFatigue)
     {
         AssetLoader.Get().LoadActor("Card_Hand_Fatigue", new AssetLoader.GameObjectCallback(this.LoadBigCardActorCallback), false, false);
     }
     else
     {
         string historyActor = ActorNames.GetHistoryActor(base.m_entity);
         AssetLoader.Get().LoadActor(historyActor, new AssetLoader.GameObjectCallback(this.LoadBigCardActorCallback), andShowBigCard, false);
     }
 }
Ejemplo n.º 5
0
 private void OnFullDefLoaded(string cardId, FullDef fullDef, object userData)
 {
     if (fullDef == null)
     {
         Debug.LogWarning(string.Format("RewardCard.OnFullDefLoaded() - FAILED to load \"{0}\"", cardId));
     }
     else
     {
         this.m_entityDef = fullDef.GetEntityDef();
         this.m_cardDef   = fullDef.GetCardDef();
         string handActor = ActorNames.GetHandActor(this.m_entityDef, this.m_cardFlair.Premium);
         AssetLoader.Get().LoadActor(handActor, new AssetLoader.GameObjectCallback(this.OnActorLoaded), null, false);
     }
 }
Ejemplo n.º 6
0
 protected override void OnDataSet(bool updateVisuals)
 {
     if (updateVisuals)
     {
         CardRewardData data = base.Data as CardRewardData;
         if (data == null)
         {
             Debug.LogWarning(string.Format("CardReward.SetData() - data {0} is not CardRewardData", base.Data));
         }
         else if (string.IsNullOrEmpty(data.CardID))
         {
             Debug.LogWarning(string.Format("CardReward.SetData() - data {0} has invalid cardID", data));
         }
         else
         {
             base.SetReady(false);
             EntityDef entityDef = DefLoader.Get().GetEntityDef(data.CardID);
             if (entityDef.IsHero())
             {
                 AssetLoader.Get().LoadActor("Card_Play_Hero", new AssetLoader.GameObjectCallback(this.OnHeroActorLoaded), entityDef, false);
                 this.m_goToRotate = this.m_heroCardRoot;
                 this.m_cardCount.Hide();
                 if (data.Premium == TAG_PREMIUM.GOLDEN)
                 {
                     this.SetUpGoldenHeroAchieves();
                 }
                 else
                 {
                     this.SetupHeroAchieves();
                 }
             }
             else
             {
                 if (UniversalInputManager.UsePhoneUI != null)
                 {
                     this.m_cardCount.Hide();
                 }
                 string handActor = ActorNames.GetHandActor(entityDef, data.Premium);
                 AssetLoader.Get().LoadActor(handActor, new AssetLoader.GameObjectCallback(this.OnActorLoaded), entityDef, false);
                 this.m_goToRotate = this.m_nonHeroCardsRoot;
             }
         }
     }
 }
 private void Awake()
 {
     this.m_manaCurveTooltipText.Text = GameStrings.Get("GLUE_COLLECTION_DECK_INFO_MANA_TOOLTIP");
     foreach (DeckInfoManaBar bar in this.m_manaBars)
     {
         bar.m_costText.Text = this.GetTextForManaCost(bar.m_manaCostID);
     }
     AssetLoader.Get().LoadActor("Card_Play_HeroPower", new AssetLoader.GameObjectCallback(this.OnHeroPowerActorLoaded), null, false);
     AssetLoader.Get().LoadActor(ActorNames.GetNameWithPremiumType("Card_Play_HeroPower", TAG_PREMIUM.GOLDEN), new AssetLoader.GameObjectCallback(this.OnGoldenHeroPowerActorLoaded), null, false);
     this.m_renameButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnRenameButtonPressed));
     if (this.m_renameButton is StandardPegButtonNew)
     {
         ((StandardPegButtonNew)this.m_renameButton).SetText(GameStrings.Get("GLUE_COLLECTION_DECK_RENAME"));
     }
     this.m_deleteButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnDeleteButtonPressed));
     if (this.m_deleteButton is StandardPegButtonNew)
     {
         ((StandardPegButtonNew)this.m_deleteButton).SetText(GameStrings.Get("GLUE_COLLECTION_DECK_DELETE"));
     }
     this.m_wasTouchModeEnabled = !UniversalInputManager.Get().IsTouchMode();
 }
    public bool AcquireActor(EntityDef entityDef, CardFlair flair, AcquireActorCallback callback, object callbackData)
    {
        if (entityDef == null)
        {
            Debug.LogError("Cannot acquire actor; entityDef is null!");
            return(false);
        }
        bool     owned = CollectionManager.Get().IsCardInCollection(entityDef.GetCardId(), flair);
        ActorKey key   = this.MakeActorKey(entityDef, flair, owned);
        string   heroSkinOrHandActor = ActorNames.GetHeroSkinOrHandActor(entityDef.GetCardType(), flair.Premium);
        ActorLoadCallbackData data   = new ActorLoadCallbackData {
            m_key          = key,
            m_owned        = owned,
            m_entityDef    = entityDef,
            m_cardFlair    = flair,
            m_callback     = callback,
            m_callbackData = callbackData
        };

        AssetLoader.Get().LoadActor(heroSkinOrHandActor, new AssetLoader.GameObjectCallback(this.OnActorLoaded), data, false);
        return(true);
    }
Ejemplo n.º 9
0
 private void OnFullDefLoaded(string cardId, FullDef fullDef, object userData)
 {
     if (fullDef == null)
     {
         this.BecomeReady();
         UnityEngine.Debug.LogWarning(string.Format("PackOpeningCard.OnFullDefLoaded() - FAILED to load \"{0}\"", cardId));
     }
     else
     {
         this.m_entityDef = fullDef.GetEntityDef();
         this.m_cardDef   = fullDef.GetCardDef();
         if (!this.DetermineRarityInfo())
         {
             this.BecomeReady();
         }
         else
         {
             string handActor = ActorNames.GetHandActor(this.m_entityDef, this.m_cardFlair.Premium);
             AssetLoader.Get().LoadActor(handActor, new AssetLoader.GameObjectCallback(this.OnActorLoaded), null, false);
         }
     }
 }
    private void LoadHeroSkinActor()
    {
        string heroSkinOrHandActor = ActorNames.GetHeroSkinOrHandActor(TAG_CARDTYPE.HERO, TAG_PREMIUM.NORMAL);

        AssetLoader.Get().LoadActor(heroSkinOrHandActor, delegate(string name, GameObject go, object callbackData) {
            if (go == null)
            {
                Debug.LogWarning(string.Format("DeckTrayHeroSkinContent.LoadHeroSkinActor - FAILED to load \"{0}\"", name));
            }
            else
            {
                Actor child = go.GetComponent <Actor>();
                if (child == null)
                {
                    Debug.LogWarning(string.Format("HandActorCache.OnActorLoaded() - ERROR \"{0}\" has no Actor component", name));
                }
                else
                {
                    GameUtils.SetParent(child, this.m_heroSkinContainer, false);
                    this.m_heroSkinObject = child;
                }
            }
        }, null, false);
    }
    public void LoadActor()
    {
        string historyActor = ActorNames.GetHistoryActor(base.m_entity);

        AssetLoader.Get().LoadActor(historyActor, new AssetLoader.GameObjectCallback(this.LoadActorCallback), null, false);
    }
 public virtual string DetermineActorNameForZone(Entity entity, TAG_ZONE zoneTag)
 {
     return(ActorNames.GetZoneActor(entity, zoneTag));
 }
Ejemplo n.º 13
0
 public override string ToString()
 {
     return(string.Format(@"{0} – {1} Actors: {2}", Title, ReleaseYear, string.Join(", ", ActorNames.ToArray())));
 }
Ejemplo n.º 14
0
 public static string BasketItem(int basketNumber, int productNumber)
 => $"/user/{ActorNames.BasketManager()}/{ActorNames.Basket(basketNumber)}/{ActorNames.BasketItem(productNumber)}";
Ejemplo n.º 15
0
 public static string ProductManager()
 => $"/user/{ActorNames.ProductManager()}";
Ejemplo n.º 16
0
 public static string Product(int productNumber)
 => $"/user/{ActorNames.ProductManager()}/{ActorNames.Product(productNumber)}";
Ejemplo n.º 17
0
 public static string Basket(int basketNumber)
 => $"/user/{ActorNames.BasketManager()}/{ActorNames.Basket( basketNumber)}";