private void TransferToInentoryPlayerFromGround() { GameObject toAdd = CellContained.GetItem().gameObject; player.TakeItemFromInventory(toAdd); CellContained.RemoveOneFromCompteur(); Control.CreateCellsForNearbyItem(); }
private void ClickOnWeaponButton() { if (CellContained.GetItem() as Weapon) { Inventory.UnequipWeaponAt(EquipAt); } else if (CellContained.GetItem() as Grenade) { Inventory.UnequipGrenade(); } }
private void ClickOnProtectionButton() { if (CellContained.GetItem() as Helmet) { Inventory.UnequipHelmet(); } else if (CellContained.GetItem() as Vest) { Inventory.UnequipVest(); } else if (CellContained.GetItem() as Bag) { Inventory.UnequipBag(); } }
private void SetImageBackground() { ItemSpriteSelector itemSpriteSelector = Control.GetComponent <ItemSpriteSelector>(); ItemType type = CellContained.GetItem().Type; Sprite newSprite = null; if (type == ItemType.AmmoPack) { newSprite = itemSpriteSelector.GetSpriteForType(type, 0, (CellContained.GetItem() as AmmoPack).AmmoType, true); } else { newSprite = itemSpriteSelector.GetSpriteForType(type, CellContained.GetItem().Level); } ImageBackground.sprite = newSprite; }
private string GetNameOfCellObject() { string name; Item containedInCell = CellContained.GetItem(); if (containedInCell.Type == ItemType.AmmoPack) { name = (containedInCell as AmmoPack).AmmoType.ToString(); } else { name = containedInCell.Type.ToString(); } int level = containedInCell.Level; ItemType typeToCheck = containedInCell.Type; if (level != 0) { name = GetNameFromItemWithLevel(level, typeToCheck); } return(name); }
private void ClickOnInventoryButton() { if (willDropItem) { Inventory.Drop(CellContained); } else if (CellContained.GetItem() as Grenade) { Inventory.EquipGrenade(CellContained); } else if (CellContained.GetItem() as Weapon) { Inventory.EquipWeaponAt(EquipAt, CellContained); } else if (CellContained.GetItem() as Helmet) { Inventory.EquipHelmet(CellContained); } else if (CellContained.GetItem() as Vest) { Inventory.EquipVest(CellContained); } else if (CellContained.GetItem() as Heal || CellContained.GetItem() as Boost) { //Bug fix temporaire CellContained.GetItem().Player = player.gameObject; //Fin bug fix temporaire (CellContained.GetItem() as Usable).Use(); Inventory.CheckMultiplePresenceAndRemove(CellContained); } else if (CellContained.GetItem() as Bag) { Inventory.EquipBag(CellContained); } }