so i am working on a clicker incremental game, I have 2 scripts set up, and its working to add on clicks, and even the upgrades work… but the text for some reason i cant get to appear and count how many you have.
here are my scripts,
using UnityEngine;
using System.Collections;
public class UpgradeManager : MonoBehaviour {
public Click click;
public UnityEngine.UI.Text itemInfo;
public float cost;
public int count = 0;
public int clickPower;
public string itemName;
private float _newCost;
void update(){
itemInfo.text = itemName + "\nCost: " + cost + "\nPower: +" + clickPower;
}
public void PurchasedUpgrade(){
if (click.virus >= cost) {
click.virus -= cost;
count += 1;
click.virusPerClick += clickPower;
cost = Mathf.Round(cost * 1.15f);
_newCost = Mathf.Pow (cost, _newCost = cost);
}
}
}
using UnityEngine;
using System.Collections;
public class Click : MonoBehaviour {
public UnityEngine.UI.Text goldDisplay;
public float virus = 0.00f;
public int virusPerClick = 1;
void update(){
goldDisplay.text = "Gold: " + virus;
}
public void Clicked(){
virus += virusPerClick;
}
}
i then drug the text object into the clicker object, but for some reason it still doesnt count. if anyone could help me out that would be great, thanks! or if you have a better suggestion about how to get this done that would be great too, just looking for any kind of thoughts as to why im not getting the text to show and update thanks!