Beispiel #1
0
 void Start()
 {
     character = (character == null) ? GetComponent <Character>() : character;
     ammo      = (ammo == null) ? GetComponent <AmmoBelt>() : ammo;
     hud       = (hud == null) ? GetComponentInChildren <HudManager>() : hud;
     character.PledgeAliegence(this);
 }
Beispiel #2
0
        public void Load(AmmoBelt belt)
        {
            guid = belt.guid;

            for (int i = 0; i < belt.GetItems().Count; i++)
            {
                UIContainerSlot slot = new UIContainerSlot(belt, i);
                slot.CanInteract += (item, mouse) => mouse.IsAir || mouse.ammo > 0;
                gridItems.Add(slot);
            }
        }
Beispiel #3
0
 public void UpdateAmmoDisplay(AmmoBelt ammo)
 {
     ammo_renderer.GetComponent <Image> ().sprite     = ammo.ActiveAmmo().GetComponent <SpriteRenderer> ().sprite;
     ammo_text.GetComponent <TextMeshProUGUI> ().text = ammo.Available().ToString();
 }