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

public class AmmoText : MonoBehaviour {

    Player player;

    Text text;

	// Use this for initialization
	void Start () {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
        text = GetComponent<Text>();
	}
	
	// Update is called once per frame
	void Update () {
        int ammo = player.ammo;
        if (ammo == -1)
            text.text = "";
        else
            text.text = "Ammo: " + ammo;
	}
}
