I made a game and I made a Magnet upgrade and I have 8 game objects to set active 1 by 1 every time when I upgrade the magnet and I have (int upgrade = 0;).
But when I upgrade these game objects it's set active, but if I quit the game and start again all these game objects are FALSE.
How can I make e.g if I upgrade to (int upgrade = 6) and to make my game objects active only from element 0 to element 6. I do upgradeMagnet(); to void Update but its make active only 1 game object depends from (int upgrade) if (int upgrade) is 5 and only game object element 5 is active.
public GameObject[] upgranded;
public int upgrade = 0;
public void upgrandeMagnetButton()
{
upgrade += 1;
upgradeMagnet();
}
void upgradeMagnet()
{
if (upgranded[upgrade])
{
upgranded[upgrade].SetActive(true);
}
}