Destroy and Object and PlayerPrefs

Hi Guys ! I’ve created this simple script to unlock a character, but obviusly when i restart the game the destroyed button object is there :smiley:

    public void ToggleBallBlueButton()
{
	GameManager.Instance.currency -= BallBlueCost;
	GameManager.Instance.Save ();
	BallBlueButton.SetActive (true);
	Destroy (TgBallBlueButton);
}

There is a way ? Maybe with the PlayerPref to Destroy the button in all games ?

Yeah…with an improvised boolean, due the player prefs doesn´t support booleans, you need to use an integer variable with 1 as true and 0 as false, just check the value with an if and set the button off if necesary.

public GameObject Button;

void Start() {
    if(PlayerPrefs.GetInt("Button") == 1){
        Button.SetActive(true);
    }else{
         Button.SetActive(false);
     }

}