How could I make a game object go through 3 different states when I press a button?

Hello,
I am making a small farming game, and I wanted to make it so whenever you press a button, the plant will change game objects, like a plant maturing in growth. I don’t know how to do this, so any help would be wonderful.

This is high level and I might be missing some details or personal preferences, but this can be an overall process.

In a GrowingPlant class, you can store the multiple Gameobjects in variables.

[SerializeField] GameObject plantState0;
[SerializeField] GameObject plantState1;
[SerializeField] GameObject plantState2;

… Or you can store them in a list.
You can then set those plants objects as children of your main Plant gameobject. Then drag those gameobjects into your main GrowingPlant class into your Gameobject variables (plantState0, etc…).

GrowingPlant

-PlantState0

-PlantState1

-PlantState2

You will disable each of these plantstate gameobjects, and enable them when you wish to see them.

Next, set up an enumerator to hold the current state of the plant.

public enum PlantStates { Seed, Sapling, Adult}
public PlantStates currentPlantState;

Then you can change the state based on a timer or something.

[SerializeField] private float timeSeedToSapling = 10;
[SerializeField] private float timeSaplingToAdult = 10;

private SetPlantState(PlantState toPlantState)
{
    if(currentPlantState == toPlantState)
      return;

     switch(toPlantState) 
     {
        case PlantState.Seed:
           plantState0.SetActive(true);
           plantState1.SetActive(false);
           plantState2.SetActive(false);
           break;
        case PlantState.Sapling:
           plantState0.SetActive(false);
           plantState1.SetActive(true);
           plantState2.SetActive(false);
           break;
        case PlantState.Adult:
           plantState0.SetActive(false);
           plantState1.SetActive(false);
           plantState2.SetActive(true);
     }

}