public void UpdateGui() { TowerStatistics stats = BuildWholeTower(); DMG.text = stats.damage.ToString(); FireRate.text = stats.fireRate.ToString(); Targets.text = stats.multiTarget.ToString(); Range.text = stats.range.ToString(); }
public TowerStatistics BuildWholeTower() { TowerStatistics retVal = new TowerStatistics(); for (int i = 0; i < transform.childCount; i++) { Mod source = transform.GetChild(i).GetComponent <FactorySlot>().myMod; retVal.damage += source.DmgMod; retVal.fireRate += source.ShotsMod; retVal.multiTarget += source.MultiMod; retVal.range += source.RangeMod; } retVal.damage += 1; retVal.fireRate += 1; retVal.multiTarget += 1; retVal.range += 1; return(retVal); }