sgtvrdrgfdsfer
Your code but working:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ItemManager : MonoBehaviour {
public Click click;
public Text itemInfo;
public float price;
public int tick;
public int count;
public string itemName;
private float basePrice;
// Use this for initialization
void Awake()
{
count = PlayerPrefs.GetInt("count", count);
price = PlayerPrefs.GetFloat("price", price);
tick = PlayerPrefs.GetInt("tick", tick);
}
// Update is called once per frame
void Update()
{
itemInfo.text = itemName + "
Price: " + price + "
Money:" + tick + ā/sā;
}
void OnApplicationQuit()
{ // To save when the game stops playing
PlayerPrefs.SetInt("count" , count);
PlayerPrefs.SetFloat("price", price);
PlayerPrefs.SetInt("tick", tick);
}
public void PurchasedItem()
{
if (click.money >= price)
{
click.money -= price;
count++;
price = Mathf.Round(basePrice * Mathf.Pow(1.15f, count));
}
}
}