So I am fairly new to unity and programming I have 6 gameobjects called Upgrade1, Upgrade2 etc, and i want to access the count variable in their script for each individual one and manipulate that from another script
The Upgrade Manager Class
public void PurchasedUpgrade(){
if(click.gold >= cost) {
click.gold -= cost;
count += 1;
click.goldperclick += clickPower;
cost = Mathf.Round (baseCost * Mathf.Pow (1.25f, count));
}
}
and then i have the persistence script
public void Fred()
{
upgrademanager = GetComponent<UpgradeManager>();
and i need to do this to get the count value from each individual item so what should i do in the persistence script Sorry if this question is confusing i dont know too much about programming and unity. I have done a few tutorials though.