Hello,
I am getting the error “Assets/Scripts/Upgrades.cs(20,17): error CS0029: Cannot implicitly convert type ‘string’ to ‘UnityEngine.UI.Text’”. The corresponding script is the following:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class Upgrades : MonoBehaviour {
public ClickScript click;
public Text itemInfo;
public float cost;
public int count = 0;
public int clickPower;
public string itemName;
private float baseCost;
void Start(){
baseCost = cost;
}
void Update(){
itemInfo = itemName + "
Cost: " + cost + "
Power: +" + clickPower;
}
public void PurchasedUpgrade(){
if (click.Money >= cost) {
click.Money -= cost;
count++;
click.MoneyPerClick += clickPower;
cost = baseCost * Mathf.Pow(1.30f, count);
}
}
}