button and PlayerPrefs

i have 3 button i want when i click button 1, hide that button and show all button with PlayerPrefs, and when i click button 2, hide that button and show all button with PlayerPrefs i test my code but work with button 2 only

void Start () {
if (PlayerPrefs.GetInt("Button1") == 1){ 

object1.gameObject.SetActive (false);

      object2.gameObject.SetActive  (true);


  }       else if (PlayerPrefs.GetInt("Button1") == 0){

      object1.gameObject.SetActive (false);

      object2.gameObject.SetActive  (true);



  } 


  if (PlayerPrefs.GetInt("Button2") == 1){
      object2.gameObject.SetActive  (false);

      object1.gameObject.SetActive (true);


  }       else if (PlayerPrefs.GetInt("Button2") == 0){

      object1.gameObject.SetActive (true);

      object2.gameObject.SetActive  (true);


  } 
}

public void whenclickbutton1(){ 
object2.gameObject.SetActive (true);

  PlayerPrefs.SetInt("Button1",1);  
      PlayerPrefs.SetInt("Button2",0);
  PlayerPrefs.Save ();
}


 public void whenclickbutton2(){

  object1.gameObject.SetActive (true);
  PlayerPrefs.SetInt("Button2",1);    
    PlayerPrefs.SetInt("Button1",0);
  PlayerPrefs.Save ();

}
    }

Not tested, but give it a try

// Drag & drop the gameObjects to enable / disable
[SerializeField]
private GameObject[] gameObjects ;

void Start ()
{
    SelectGameObject( PlayerPrefs.GetInt("SelectedGameObject" ) )
}

// Provide this function in the `onClick` events
public void SelectGameObject( GameObject gameObject )
{
    int index = -1 ;

    for (int i = 0; i < gameObjects.Length; i++)
    {
        if( gameObjects*.GetInstanceID() == gameObject )*

{
index = i ;
}
}
if( i >= 0 )
SelectGameObject( i );
else
Debug.LogError(“The given gameObject is not part of the list”)
}

public void SelectGameObject( int gameObjectIndex )
{
if( gameObjectIndex < 0 || gameObjectIndex >= gameObjects.Length )
{
Debug.LogError("No gameObject at the index " + gameObjectIndex );
return ;
}

PlayerPrefs.SetInt(“SelectedGameObject”, gameObjectIndex);
PlayerPrefs.Save ();

for (int i = 0; i < gameObjects.Length; i++)
{
gameObjects*.SetActive( i == gameObjectIndex );*
}
}