void SetUnitLeadershipInfo(PartyUnit partyUnit) { transform.Find("Panel/LeaderAttributes").gameObject.SetActive(true); // get attribute text Text attributeText = transform.Find("Panel/LeaderAttributes/Values/Leadership").GetComponent <Text>(); // set current and max leadership attributeText.text = GetLeadershipConsumedByPartyUnitsExcludingLeader(partyUnit).ToString() + "/" + partyUnit.GetEffectiveLeadership().ToString(); // verify if base leadership does not equal to effective leadership if (partyUnit.GetEffectiveLeadership() != partyUnit.UnitLeadership) { // Display how leadership is calculated attributeText.text += "("; // set default unit power without bonuses (without just upgraded stats power bonus) attributeText.text += baseStatPreviewStyleStart + partyUnit.UnitLeadership.ToString() + baseStatPreviewStyleEnd; // get and add skill bonus to text if upgrade unit panel is active AddBonusInfoToText(attributeText, partyUnit.GetLeadershipSkillBonus(), skillBonusPreviewStyleStart, skillBonusPreviewStyleEnd); // get and add items bonus to text if upgrade unit panel is active AddBonusInfoToText(attributeText, partyUnit.GetLeadershipItemsBonus(), itemBonusPreviewStyleStart, itemBonusPreviewStyleEnd); // close brackets attributeText.text += ")"; } }
void SetLeaderInformation() { // Activate required menu transform.Find("FocusedName").gameObject.SetActive(true); transform.Find("FocusedDescription").gameObject.SetActive(true); transform.Find("PartyFocus").gameObject.SetActive(true); // get party leader PartyUnit partyLeader = focusedObject.GetComponent <PartyUnitUI>().LPartyUnit; // populate with info from hero transform.Find("FocusedName").GetComponent <Text>().text = partyLeader.GivenName; transform.Find("FocusedDescription").GetComponent <Text>().text = partyLeader.UnitName; transform.Find("PartyFocus").Find("LevelValue").GetComponent <Text>().text = partyLeader.UnitLevel.ToString(); transform.Find("PartyFocus").Find("LeadershipValue").GetComponent <Text>().text = partyLeader.GetEffectiveLeadership().ToString(); }