using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HUD : MonoBehaviour {
    public static HUD instance;
    private Text coinCount, health;
    private GameObject sword, shield;

    void Awake()
    {
        instance = this;
        coinCount = transform.FindChild("Coins").FindChild("Value").GetComponent<Text>();
        health = transform.FindChild("Health").FindChild("Value").GetComponent<Text>();
        sword = transform.FindChild("Sword").gameObject;
        shield = transform.FindChild("Shield").gameObject;
    }

    public void SetCoinCount(int count)
    {
        coinCount.text = count.ToString();
    }
    public void UpdateHealth(int val)
    {
        health.text = val.ToString();
    }
    public void SetSword(bool vis)
    {
        sword.SetActive(vis);
    }
    public void SetShield(bool vis)
    {
        shield.SetActive(vis);
    }
}
