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

public class SecondaryAmmoCounter : MonoBehaviour
{
    public Player p;
    private Text text;

    // Use this for initialization
    void Start()
    {
        text = GetComponent<Text>();
    }

    // Update is called once per frame
    void Update()
    {
        if (p.weapons[1] == 0)
        {
            text.text = "";
        } else
        {
            int current = Mathf.Abs(p.currentWeapon - 1);
            if (current != 0)
            {
                text.text = "" + p.mag[p.weapons[current]] + "/" + p.ammo[p.weapons[current]];
            }
            else
            {
                text.text = "" + p.mag[p.weapons[current]] + "/inf";
            }
        }
    }
}
