コード例 #1
0
    public List <ItemIdCount> TryFetchAll()
    {
        List <ItemIdCount> itemlist = GetItems();

        SaveItems(new List <ItemIdCount>());

        if (gameObj != null)
        {
            ItemDropMousePickRandomItem iDrop = gameObj.GetComponent <ItemDropMousePickRandomItem>();
            if (iDrop != null)
            {
                iDrop.RemoveAll();
            }
        }
        CheckDestroyObj();
        return(itemlist);
    }
コード例 #2
0
    public bool TryFetch(int index, int protoId, int count)
    {
        int removeIndex;

        if (CanFetch(index, protoId, count, out removeIndex))
        {
            List <ItemIdCount> itemlist = GetItems();
            itemlist.RemoveAt(removeIndex);
            SaveItems(itemlist);
            if (gameObj != null)
            {
                ItemDropMousePickRandomItem iDrop = gameObj.GetComponent <ItemDropMousePickRandomItem>();
                if (iDrop != null)
                {
                    iDrop.Remove(index, protoId, count);
                }
            }
            CheckDestroyObj();
            return(true);
        }
        CheckDestroyObj();
        return(false);
    }