public void OnInsertItem(ItemSlot slot) { if (slot.m_Item.m_Info.IsBowl()) { BowlInfo bowlInfo = (BowlInfo)slot.m_Item.m_Info; if (bowlInfo.m_LiquidType != LiquidType.Water) { ((Bowl)slot.m_Item).Spill(-1f); bowlInfo.m_LiquidType = LiquidType.Water; } } }
public void Pour(float fill_amount) { if (!this.m_ContainerSlot.m_Item) { return; } BowlInfo bowlInfo = (BowlInfo)this.m_ContainerSlot.m_Item.m_Info; bowlInfo.m_Amount += fill_amount; bowlInfo.m_Amount = Mathf.Min(bowlInfo.m_Amount, bowlInfo.m_Capacity); this.m_Amount += fill_amount; this.m_Amount = Mathf.Min(this.m_Amount, this.m_Capacity); }