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

public class PrimaryAmmoCounter : 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[p.currentWeapon] != 0)
        {
            text.text = "" + p.mag[p.weapons[p.currentWeapon]] + "/" + p.ammo[p.weapons[p.currentWeapon]];
        } else
        {
            text.text = "" + p.mag[p.weapons[p.currentWeapon]] + "/inf";
        }
    }
}
