Disabled button after coming back from another scene

I have a menu scene where there is three button options. Once player click one button, it bring them to a description scene. when player click next on the description scene, they will go back to the menu scene and I want the clicked button to be not visible. After all three button are clicked, it automatically brings them to the last scene. But I cant even make the first button clicked not visible.

heres what I’ve tried

public void NavigateVideoOne() {
     Debug.Log ("video one");
     Application.LoadLevel("VideoOne");
}
public static void disableButton(){
     Debug.Log ("disable button");
     navigateVideoOneButton = GameObject.Find("Button");//GameObject.FindGameObjectWithTag ("ButtonOne");
     //Debug.Log(navigateVideoOneButton);
     //navigateVideoOneButton.GetComponent<Button>().interactable = false;
     navigateVideoOneButton.SetActive(false);
}

One more concern is that I want the app to restart all over again after 2 minutes of inactivity. I am worried that the disabled buttons will not reload. How do I avoid that?

Please explain in details as I am new to coding and unity. Appreciate your help!!

One option would be,

Use playerprefs to save data, so, when you press button#1, save value into PlayerPrefs like,

PlayerPrefs.SetInt("button1",1);

and then when entering the scene with that button, check if that value is 1 and disable that button

int buttonState = PlayerPrefs.GetInt("button1",0);

You can also search for
DontDestroyOnLoad (to keep your gameobject/script alive between scenes)
or just search for examples about: passing data between scenes

1 Like

If i use DontDestroyOnLoad, will the disabled buttons work again? I want to reload the entire project after 2 minutes of inactivity including the disabled button so that it works again after the reload. Its basically like a replay but starts automatically after 2minutes of not doing anything.

You could use a script with booleans attached to a game object with a dontdestroyonload which holds what button may be on or off. and let the buttons check that script if they are interactable on Awake.

just an idea, not sure if this will work for you