void OnTriggerEnter(Collider other) { if (other.gameObject.tag != "Player") { return; } if (!gaveAmmo) { FireBow fb = other.GetComponentInChildren <FireBow> (); int currentSelection = fb.currentSelection; fb.ammo[currentSelection] += amount; gaveAmmo = true; Destroy(gameObject); } }
public void Draw() { Background.Draw(_location); if (_selectedItem != null) { if (_selectedItem.Width > 8) { _selectedItem.Draw(_location + SelectedItemLocation16_16); } else { _selectedItem.Draw(_location + SelectedItemLocation8_16); } } if (_agent.Player.Inventory.HasBoomerang) { Boomerang.Draw(BoomerangLocation + GridLocation + _location); } if (_agent.Player.Inventory.BombCount >= 1) { Bomb.Draw(BombLocation + GridLocation + _location); } if (_agent.Player.Inventory.ArrowLevel == Secondary.SilverArrow) { SilverArrow.Draw(ArrowLocation + GridLocation + _location); } else if (_agent.Player.Inventory.ArrowLevel == Secondary.Arrow) { Arrow.Draw(ArrowLocation + GridLocation + _location); } if (_agent.Player.Inventory.BowLevel == Secondary.FireBow) { FireBow.Draw(BowLocation + GridLocation + _location); } else if (_agent.Player.Inventory.BowLevel == Secondary.Bow) { Bow.Draw(BowLocation + GridLocation + _location); } if (_agent.Player.Inventory.Coins >= 2) { AlchemyCoin.Draw(CoinLocation + GridLocation + _location); } if (_agent.Player.Inventory.HasATWBoomerang) { ATWBoomerang.Draw(ATWBoomerangLocation + GridLocation + _location); } if (_agent.Player.Inventory.HasBombLauncher) { BombLauncher.Draw(BombLauncherLocation + GridLocation + _location); } DrawExtraItem(_slot7Sprite, Slot7Location); DrawExtraItem(_slot8Sprite, Slot8Location); CursorGrid.Draw(CursorSize * _cursorPosition.ToVector2() + GridLocation + _location); }