private void RemoveItemImage(ItemInfo itemRemoved) { ItemImage itemImage = GetItemImage(itemRemoved); ItemImages.Remove(itemImage); Destroy(itemImage.gameObject); }
private void AddItemImage(ItemInfo itemAdded) { GameObject itemObject = GameObject.Instantiate(ItemImagePrefab, ItemsGroup.transform); ItemImage itemImage = itemObject.GetComponent <ItemImage>(); itemImage.SetItem(itemAdded); itemImage.SetSprite(itemAdded.Sprite); itemImage.SetQuantityText(itemAdded.Quantity); ItemImages.Add(itemImage); }
private void UpdateEquipPending(ItemImage selectedItemImage, ItemInfo selectedItem) { if (PendingEquippedItem != null) { ItemImage previousEquippedImage = GetItemImage(PendingEquippedItem); previousEquippedImage.SetSprite(PendingEquippedItem.Sprite); } selectedItemImage.SetSprite(selectedItem.EquippedSprite); PendingEquippedItem = selectedItem; }
private void UpdateArrow() { Arrow.SetActive(false); if (SelectedItemIndex >= 0) { Arrow.SetActive(true); ItemImage selectedItemImage = GetItemImage(SelectedItemIndex); Transform arrowPoint = selectedItemImage.ArrowPoint; Vector3 newArrowPosition = arrowPoint.position; Arrow.transform.position = newArrowPosition; } }
private void UpdateTexts() { if (SelectedItemIndex >= 0) { ItemImage selectedItemImage = GetItemImage(SelectedItemIndex); ItemBase selectedItem = selectedItemImage.Item; LocalizeScriptName.TableEntryReference = selectedItem.VariableName; LocalizeScriptDescription.TableEntryReference = selectedItem.VariableName; } else { LocalizeScriptName.TableEntryReference = "empty"; LocalizeScriptDescription.TableEntryReference = "empty"; } }
private void UpdateEquipUnequipPending() { ItemImage selectedItemImage = GetItemImage(SelectedItemIndex); ItemInfo selectedItem = Inventory.GetInventoryItem(selectedItemImage.Item); if (selectedItem.IsEquippable) { Inventory.SoundController.PlayClip(Inventory.SoundController.Seleccion); if (IsItemPendingEquipped(selectedItem)) { UpdateUnequipPending(selectedItemImage, selectedItem); } else { UpdateEquipPending(selectedItemImage, selectedItem); } } }
private void UpdateItemImage(ItemInfo itemUpdated) { ItemImage itemImage = GetItemImage(itemUpdated); itemImage.SetQuantityText(itemUpdated.Quantity); }
private ItemImage GetItemImage(int index) { ItemImage itemImage = ItemImages.ElementAt(index); return(itemImage); }
private ItemImage GetItemImage(ItemBase itemInfo) { ItemImage itemImage = ItemImages.Find(temp => temp.Item.Equals(itemInfo)); return(itemImage); }
private void UpdateUnequipPending(ItemImage selectedItemImage, ItemInfo selectedItem) { selectedItemImage.SetSprite(selectedItem.Sprite); PendingEquippedItem = null; }