Hey all,
I'm somewhat new to NGUI and I'm having trouble updating the text of an existing label with a variable through script. I'm building a unit purchase menu and want to display how many units are currently owned. This variable is housed in a different script and I can't seem to access due to some null errors. Lines 14 and 40 are the ones receiving the errors.
using UnityEngine;
using System.Collections;
public class PurchaseManager : MonoBehaviour
{
public UILabel countLabel;
internal string countLabelString;
void Start ()
{
countLabel.text = "hello";
}
public void PurchaseAuxilia() // Buy an Auxilia
{
if (WorldMapManager.stockedGold >= 50)
{
WorldMapManager.stockedGold -= 50;
WorldMapManager.AuxiliaUnits += 1;
countLabelString = WorldMapManager.AuxiliaUnits.ToString();
countLabel.text = "countLabelString";
}
}
Thanks in advance!