Script don't update "gems" in UI when i have buy something.

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]*
*

Im not sure what youre calling after opening the shop. But my guess is youre not calling UpdateGemCount() or OpenShop() because these look ok.

Have you correctly assigned gemCountText and playerGemCountText

Also ensure youre passing through an integer to the two methods above.

Try simply putting a debug text like UpdateGemCount(999) in awake func

I found the problem, it was my shop script in the BuyItem method. just put in UIManager.Instance.UpdateGemCount(_player.diamonds); and it worked.

Thanks anyway for the help.