示例#1
0
        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;
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
        }