- Home /
Question by
BreadMan32 · Nov 30, 2016 at 07:37 AM ·
error messageerror-cs1525
error CS1525: Unexpected symbol '
so I was making my first game and I came across this bug
using UnityEngine; using System.Collections;
public class UpgradeManager : MonoBehaviour {
public Click1 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 PurchaseUpgrade() {
if (click.wood >= cost) {
click.wood -= cost;
count += 1;
click.woodperclick += clickPower;
cost = Mathf.Round (cost * 1.15f);
_newCost = Mathf.Pow (cost, _newCost = cost);
}
}
}
Comment
Answer by tkamruzzaman · Nov 30, 2016 at 09:15 AM
itemInfo.text = itemName + "\nCost: " + cost "\nPower: +" + clickPower;
change it to
itemInfo.text = itemName + "\nCost: " + cost + "\nPower: " + clickPower;
Or
itemInfo.text = itemName + "\nCost: " + cost + "\nPower: +" + clickPower;
assu$$anonymous$$g he wants his textfield to display e.g. "Power +5"