コード例 #1
0
    public void ShowTooltip(UnitController unit)
    {
        m_cost.text = unit.GetUnitCost().ToString();
        CombatUnit combatUnit   = unit.GetComponent <CombatUnit>();
        float      dps          = combatUnit.GetAttackDamage() / combatUnit.GetAttackSpeed();
        float      dpsTruncated = (float)(Math.Truncate(dps * 100.0) / 100.0);

        m_damage.text = dpsTruncated.ToString();
        m_health.text = combatUnit.GetMaxHealth().ToString();
    }