I came from Unreal Engine 4. I created a script, and I keep getting an error:
Assets/scripts/UpgradeManager.cs(17,18): error CS1061: Type `UnityEngine.UI.Text' does not contain a definition for `Text' and no extension method `Text' of type `UnityEngine.UI.Text' could be found (are you missing a using directive or an assembly reference?)
My code is:
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;
public float _newCost;
void Update()
{
iteminfo.Text = itemName + "/nCost: " + cost + "/nPower: +" + clickpower;
}
public void PurchaseUpgrade()
{
if (click.money >= cost)
{
click.money -= cost;
count += 1;
click.moneyperclick += clickpower;
cost = Mathf.Round(cost * 1.15f);
_newCost = Mathf.Pow(cost, _newCost = cost);
}
}
}