Esempio n. 1
0
    public void OnInsertItem(ItemSlot slot)
    {
        if (!(slot == this.m_WoodSlot))
        {
            bool flag = false;
            for (int i = 0; i < this.m_CookingSlots.Length; i++)
            {
                if (slot == this.m_CookingSlots[i])
                {
                    flag = true;
                    break;
                }
            }
            if (flag && slot.m_Item.m_Info.m_Type == ItemType.Bowl)
            {
                slot.m_Item.gameObject.GetComponent <Collider>().isTrigger = true;
                slot.Deactivate();
                ((Bowl)slot.m_Item).OnFirecampAdd(this);
            }
            return;
        }
        if (slot.m_Item.m_Info.IsLiquidContainer())
        {
            LiquidContainer liquidContainer = (LiquidContainer)slot.m_Item;
            if (liquidContainer.m_LCInfo.m_Amount > 0f)
            {
                liquidContainer.Spill(-1f);
                this.Extinguish();
            }
            slot.RemoveItem();
            InventoryBackpack.Get().InsertItem(liquidContainer, null, null, true, true, true, true, true);
            return;
        }
        this.m_BurningDuration -= slot.m_Item.m_Info.m_AddFirecamBurningTime;
        if (this.m_BurningDuration < 0f)
        {
            this.m_BurningDuration = 0f;
        }
        this.m_FireLevel = CJTools.Math.GetProportionalClamp(1f, 0f, this.m_BurningDuration, 0f, this.GetBurningLength());
        Component item = slot.m_Item;

        slot.RemoveItem();
        UnityEngine.Object.Destroy(item.gameObject);
    }