private IEnumerator FishRoutine(ItemProvider source, int quantity)
        {
            is_fishing = true;

            float timer = 0f;

            while (is_fishing && timer < 3f)
            {
                yield return(new WaitForSeconds(0.02f));

                timer += 0.02f;

                if (IsMoving())
                {
                    is_fishing = false;
                }
            }

            if (is_fishing)
            {
                source.RemoveItem();
                source.GainItem(this, quantity);
            }

            is_fishing = false;
        }
Esempio n. 2
0
        public override void DoAction(PlayerCharacter character, ItemSlot slot, Selectable select)
        {
            if (select.HasGroup(merge_target))
            {
                ItemProvider  provider  = select.GetComponent <ItemProvider>();
                InventoryData inventory = slot.GetInventory();

                provider.RemoveItem();
                provider.PlayTakeSound();
                inventory.RemoveItemAt(slot.index, 1);
                character.Inventory.GainItem(inventory, filled_item, 1);
            }
        }