private void SetHeroPowerInfo(string heroPowerCardID, FullDef def, CardFlair cardFlair) { if (heroPowerCardID.Equals(this.m_heroPowerID)) { EntityDef entityDef = def.GetEntityDef(); if (cardFlair.Premium == TAG_PREMIUM.GOLDEN) { this.m_heroPowerActor.Hide(); this.m_goldenHeroPowerActor.Show(); this.m_goldenHeroPowerActor.SetEntityDef(def.GetEntityDef()); this.m_goldenHeroPowerActor.SetCardDef(def.GetCardDef()); this.m_goldenHeroPowerActor.SetUnlit(); this.m_goldenHeroPowerActor.SetCardFlair(cardFlair); this.m_goldenHeroPowerActor.UpdateAllComponents(); } else { this.m_heroPowerActor.Show(); this.m_goldenHeroPowerActor.Hide(); this.m_heroPowerActor.SetEntityDef(def.GetEntityDef()); this.m_heroPowerActor.SetCardDef(def.GetCardDef()); this.m_heroPowerActor.SetUnlit(); this.m_heroPowerActor.UpdateAllComponents(); } string name = entityDef.GetName(); this.m_heroPowerName.Text = name; string cardTextInHand = entityDef.GetCardTextInHand(); this.m_heroPowerDescription.Text = cardTextInHand; } }
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 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); } }
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); } } }