How to save bool to PlayerPrefs

Hi I have a payment system for my game set up here’s my code :

using UnityEngine;
using System.Collections;
using CafeBazarIab ;
using UnityEngine .UI ;

public class StoreEventHandler : MonoBehaviour ,IStoreEventHandler
{
	public Button T55;
	public Button Tiger2;
	public Button Cobra;

	#region IStoreEventHandler implementation

	void Start()
	{
		T55.interactable = false;
		Tiger2.interactable = false;
		Cobra.interactable = false;
	}

	public void ProcessPurchase (ShopItem item)
	{
		if(item .SKU =="tank")
		{
			StoreHandler .Instance .Consume (item );
		}
	}
	
	public void OnConsumeFinished (ShopItem item)
	{
		if(item .SKU =="tank")
		{
			T55.interactable = true;
			Tiger2.interactable = true;
			Cobra.interactable = true;
		}
	}
}

now each time the player buy something in the game the intractability of my 3 buttons goes to true;
but the problem is each time he closes the game the intractability goes back to false how; should i save the process so the player doesn’t have to buy again to set them back to true ?

PlayerPrefs does not contain a function for setting bools (It’s not the best class unity’s offered to us. It’s a bit slow and doesn’t support all data types). However you could just use PlayerPrefs.SetInt. A 1 = true and a 0 = false. That’s all a bool really is anyways. You could alos use PlayerPrefs.SetString, using “true” and “false” as the string contents. Neither method is ideal for your scenario, but you gotta use what ya got.

EDIT:
Also, it’s probably important to mention that playerprefs is not good for save states. It’s made for things like game settings and option. Consider using serialization for game states

Get by using this line:
bool myBool = PlayerPrefs.GetInt (“VariableName”) == 1 ? true : false;

Set by using this line:
PlayerPrefs.SetInt (“VariableName”, true ? 1 : 0);