internal void PreviewModel(AvatarModel heroModel, AvatarModel target, bool friendly) { Card c = target != null ? target.Card : null; Prepare(heroModel, c, global::WhereAmI.Board); //on board there is no color ImageColor.SetActive(false); PanelAttack.GetComponent <PanelValue>().Prepare(target != null ? target.ActualAttack:0); PanelHealth.GetComponent <PanelValue>().Prepare(target != null ? target.ActualHealth:0); PanelArmor.GetComponent <PanelValue>().Prepare(target != null ? target.Armor : 0); ImageBorder.SetActive(target != null); if (target != null) { ImageBorder.GetComponent <Image>().color = target.MovesLeft > 0 ? Color.green : Color.black; ImageBorder.GetComponent <Image>().material = Image.defaultGraphicMaterial; if (!friendly) { ImageBorder.GetComponent <Image>().color = Color.red; ImageBorder.GetComponent <Image>().material = SpriteManager.Font.material; } } bool hasTaunt = false; bool hasSticky = false; if (target != null) { foreach (CastedCard cc in target.Effects) { if (cc.Params.ContainsKey(CastedCardParamType.Taunt)) { hasTaunt = true; } } foreach (KeyValuePair <Side, AvatarModel> kvp in target.AdjacentModels) { if (kvp.Value != null) { foreach (CastedCard cc in kvp.Value.Effects) { if (cc.Params.ContainsKey(CastedCardParamType.Sticky)) { hasSticky = true; } } } } } ImageTaunt.SetActive(hasTaunt); ImageSticky.SetActive(hasSticky); }
public void PreviewCardHand(AvatarModel heroModel, Card card, WhereAmI whereAmI) { Prepare(heroModel, card, whereAmI); PanelCrystal.GetComponent <PanelValue>().Prepare(Card != null? Card.Cost:0); PanelAttack.GetComponent <PanelValue>().Prepare(Card != null && Card.Params.ContainsKey(ParamType.Attack) ? Card.Params[ParamType.Attack] : 0); PanelHealth.GetComponent <PanelValue>().Prepare(Card != null && Card.Params.ContainsKey(ParamType.Health) ? Card.Params[ParamType.Health] : 0); ImageBorder.GetComponent <Image>().color = card != null && heroModel != null && card.Cost > heroModel.ActualMana ? Color.black : (whereAmI == global::WhereAmI.SpecialPower && heroModel.AlreadyUsedPower ? Color.black : Color.green); if (whereAmI == global::WhereAmI.TopInfo) { ImageBorder.GetComponent <Image>().color = Color.white; } //PanelCrystal.GetComponent<Image>().color = card != null && card.Cost > heroModel.ActualMana ? Color.black : Color.white; //PanelCrystal.GetComponent<PanelValue>().Text.GetComponent<Text>().color = card != null && heroModel != null && card.Cost > heroModel.ActualMana ? Color.black : Color.white; }