rabidus-test/Assets/BNG Framework/Scripts/Weapons/AmmoDisplay.cs

19 lines
423 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace BNG {
public class AmmoDisplay : MonoBehaviour {
public RaycastWeapon Weapon;
public Text AmmoLabel;
void OnGUI() {
string loadedShot = Weapon.BulletInChamber ? "1" : "0";
AmmoLabel.text = loadedShot + " / " + Weapon.GetBulletCount();
}
}
}