Esempio n. 1
0
    private bool LoseItem(ItemInfo info, int amount)
    {
        if (MWarehouse == null || info == null || !info.item || amount < 1)
        {
            return(false);
        }
        if (!BackpackManager.Instance.TryGetItem_Boolean(info, amount))
        {
            return(false);
        }
        BackpackManager.Instance.GetItem(info, amount);
        MWarehouse.LoseItemSimple(info, amount);
        ItemAgent ia = GetItemAgentByInfo(info);

        if (ia)
        {
            ia.UpdateInfo();
        }
        UpdateUI();
        if (!BackpackManager.Instance.IsUIOpen)
        {
            BackpackManager.Instance.OpenWindow();
        }
        return(true);
    }