Exemplo n.º 1
0
    public void SellCartItems()
    {
        for (int i = 0; i < cartItems.Count;)
        {
            GameObject item = cartItems[i];
            Debug.Log(item.name);
            store.ConvertToStoreItem(item);
            RemoveItemFromTempCart(item);
            Grid.RemoveGrid(player.GridBG);

            Dictionary <string, object> entry = store.GetDictionary(player.List, item.name);
#if UNITY_EDITOR
            Serializer.AddJSONItem(store.List, entry, store.Json);
            Serializer.RemoveJSONItem(player.List, entry, player.Json);
#endif
        }
        CompleteTransaction("sell");
        player.ToggleBag();
        store.scrollContainer.SetActive(true);
    }