static void ShowDialogueForItem(AItemBase item) { switch (item.EItemType) { case EItemType.Generic: { Tutorial.ShowForIDIfNeeded(ETutorialId.GenericItemPicked); break; } case EItemType.Consumable: { if (item is HungerDecreaser) { Tutorial.ShowForIDIfNeeded(ETutorialId.HungerItemPicked); } else if (item is StressDecreaser) { Tutorial.ShowForIDIfNeeded(ETutorialId.StressItemPicked); } break; } case EItemType.Receipt: { Tutorial.ShowForIDIfNeeded(ETutorialId.CraftItemPicked); break; } default: break; } }
public bool TryAddItemToInventory(AItemBase item) { if (_items.Count < kMaxInventoryCapacity) { _items.Add(item); //ShowDialogueForItem(item); AudioSource.PlayClipAtPoint(_sound, Camera.main.transform.position, 0.01f); InventoryChanged(); return(true); } return(false); }
private void OnItemSelected(Core.Inventory.AItemBase arg1, ContainerItem arg2) { PlayerInventory.Instance.TryAddItemToInventory(arg1); var templist = _current.Items.ToList(); templist.Remove(arg1.ItemID); _current.Items = templist.ToArray(); Destroy(arg2.gameObject); if (_current.Items.Length <= 0) { gameObject.SetActive(false); } }
public bool TryAddItemToInventory(AItemBase item) { if (_items.Count < kMaxInventoryCapacity) { _items.Add(item); //ShowDialogueForItem(item); FanfareMessage.ShowWithText(string.Format("{0} added to inventory.", item.Name)); Debug.Log(item.ItemID + " was added to inventory."); InventoryChanged(); return(true); } return(false); }