private void ConfigureSection(TipPopUpSection newSection, TipSectionData sectionData) { newSection.PopulateSection(sectionData); newSection.transform.SetParent(verticalLayoutGroup, false); SetRectTransformHeight(newSection.GetComponent <RectTransform>(), sectionData.height); newSection.gameObject.SetActive(true); }
public void OpenBattleRulesPopUp() { TipSectionData[] battleRulesContent = new TipSectionData[] { new TipSectionData(battleRulesSprite, 230.0f), new TipSectionData(battleRules, 2300.0f) }; OpenTipPopUp(battleRulesContent, title: "Battle Rules"); }
public void PopulateSection(TipSectionData tipSectionData) { Color c = tipSectionData.color; Color color = c; // Change the default color from 'transparent' to white if (c.r + c.g + c.b + c.a < 0.01) { color = Color.white; } if (tipSectionData.background != null) { backgroundImage.sprite = tipSectionData.background; backgroundImage.color = color; } text.text = tipSectionData.message; text.color = color; }
public override void OpenTip(TipPopUpOpener tipPopUpOpener) { Card c = cardToPullData; title = c.GetColoredTitleForTip(); TipSectionData cardArt = new TipSectionData(background: c.GetCardVerticalSprite()); TipSectionData explanatoryText = new TipSectionData(c.GetExplanatoryText(), textHeight); if (cardToPullData.IgnoreOpponentsBlock) { TipSectionData ignoreBlock = new TipSectionData(message: " -> IGNORES PROTECTION.", background: ignoreIconSprite, height: 70); tipData = new[] { ignoreBlock, explanatoryText, cardArt }; } else { tipData = new[] { explanatoryText, cardArt }; } base.OpenTip(tipPopUpOpener); }