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); }