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 ?