Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ItemManager : MonoBehaviour {
- public UnityEngine.UI.Text itemInfo;
- public Click click;
- public float cost;
- public int tickValue;
- public int count2;
- public string itemName;
- private float baseCost;
- public float cost2;
- private void Start()
- {
- baseCost = cost2;
- }
- private void Update()
- {
- itemInfo.text = itemName + "\nCost: " + cost2 + "\nDollars: " + tickValue + "/s";
- }
- public void PurchasedItem()
- {
- if(click.gold >= cost2)
- {
- click.gold -= cost;
- count2 += 1;
- cost2 = Mathf.Round (baseCost * Mathf.Pow(1.40f, count2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement