Hello, hope someone can help me, i got a problem with that the script don’t update “gems” after i buying in the shop, someone that can help me with the problem? proberly easy but i don’t really see what i have forget or done wrong.
private static UIManager _instance;
public static UIManager Instance
{
get
{
if (_instance == null)
{
throw new UnityException();
}
return _instance;
}
}
public Text playerGemCountText;
public Image selectionImg;
public Text gemCountText;
public Image[] healthBars;
private void Awake()
{
_instance = this;
}
public void OpenShop(int gemCount)
{
playerGemCountText.text = "" + gemCount + "G";
}
public void UpdateShopSelection(int yPos)
{
selectionImg.rectTransform.anchoredPosition = new Vector2(selectionImg.rectTransform.anchoredPosition.x, yPos);
}
public void UpdateGemCount(int count)
{
gemCountText.text = "" + count;
}
public void UpdateLives(int livesRemaining)
{
//loop through lives
for (int i = 0; i <= livesRemaining; i++)
{
//do nothing till we hit the max
if(i == livesRemaining)
{
//hide this one
healthBars*.enabled = false;*
}
}
}
[124828-d2as.jpg|124828]*
*