Пример #1
0
    public void SetTroopStats()
    {
        TroopScript ts = troop.GetComponent <TroopScript>();

        txt_level.text       = "Level: " + ts.GetLevel();
        txt_damage.text      = "Damage: " + ts.GetDamage();
        txt_cooldown.text    = "Cooldown: " + ts.GetShootCooldown();
        txt_view_radius.text = "View Radius: " + ts.GetViewRadius();
        txt_upgradecost.text = "Upgrade $" + ts.GetUpgradeCost();
    }
Пример #2
0
    public void LevelUp()
    {
        TroopScript ts   = troop.GetComponent <TroopScript>();
        long        cost = ts.GetUpgradeCost();

        Debug.Log(cost);
        if (stats.GetCash() >= cost && ts.GetLevel() != 69)
        {
            stats.AdjustCash(-cost);
            ts.LevelUp();
        }

        SetTroopStats();

        float scale = troop.GetComponent <TroopScript>().GetViewRadius() * 2;

        viewDistanceHighlighter.transform.localScale = new Vector3(scale, 0.001f, scale);
    }