Ejemplo n.º 1
0
    public void SetUnitInitiativeInfo(PartyUnit partyUnit)
    {
        // Get UI text
        Text attributeText = transform.Find("Panel/UnitInitiative/Value").GetComponent <Text>();

        // display effective value
        attributeText.text = partyUnit.GetEffectiveInitiative().ToString();
        // verify if base value does not equal to effective value
        if (partyUnit.GetEffectiveInitiative() != partyUnit.UnitBaseInitiative)
        {
            // Display how effective value is calculated
            // open brackets
            attributeText.text += "(";
            // set base unit move points without bonuses
            attributeText.text += baseStatPreviewStyleStart + partyUnit.UnitBaseInitiative.ToString() + baseStatPreviewStyleEnd;
            // get and add skill bonus to text
            AddBonusInfoToText(attributeText, partyUnit.GetInitiativeSkillBonus(), skillBonusPreviewStyleStart, skillBonusPreviewStyleEnd);
            // get and add bonus from items to text
            AddBonusInfoToText(attributeText, partyUnit.GetInitiativeItemsBonus(), itemBonusPreviewStyleStart, itemBonusPreviewStyleEnd);
            // close brackets
            attributeText.text += ")";
        }
    }