Ejemplo n.º 1
0
    void FirstTargetContainer_AddedItem(ItemData arg1, bool arg2)
    {
        Debug.Log("Move Item 1");

        if (!FirstTargetContainer.containerItems.Exists(x => x.ItemID == 1 && x.stackSize == 1))
        {
            IntegrationTest.Fail(FirstTargetContainer.gameObject);
        }

        Debug.Log("item data to be moved: " + arg1);

        ItemContainerManager.MoveItem(arg1, FirstTargetContainer, SecondTargetContainer);
    }
Ejemplo n.º 2
0
    public void AddItem(ItemData addItem, int amount, bool isSave)
    {
        if (IsSwapNeeded())
        {
            //Should only swap single item in container (first item in container items list)
            ItemData swapItem = itemContainer.containerItems[swapIndex];

            ItemContainerManager.MoveItem(swapItem, itemContainer, addItem.ownerContainer);
            AddItemToContainer(addItem, amount, isSave);
        }
        else
        {
            AddItemToContainer(addItem, amount, isSave);
        }
    }
    public void OnDrop(PointerEventData data)
    {
        if (data != null && data.pointerDrag.GetComponent <ItemDataComponent>() != null)
        {
            var originalObj = data.pointerDrag;
            if (originalObj == null)
            {
                return;
            }

            if (originalObj.GetComponent <ItemDataComponent>().itemData.OwnerContainer != GetComponent <ItemContainer>())
            {
                ItemContainerManager.MoveItem(originalObj.GetComponent <ItemDataComponent>().itemData, GetComponent <ItemContainer>());
            }
        }
    }
    public void PutGameItem(List <ItemData> items)
    {
        if (container == null)
        {
            throw new Exception("You must provide a container to your GameItemContainerInserter");
        }
        else
        {
            if (onReciveItems != null)
            {
                onReciveItems(items);
            }

            foreach (ItemData item in items)
            {
                ItemContainerManager.MoveItem(item, container);
                Destroy(item.gameObject);
            }
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// Drop the dragged object.
    /// </summary>

    void Drop()
    {
        Collider col = UICamera.lastHit.collider;

        Debug.Log(col);
        ItemContainer container = (col != null) ? col.gameObject.GetComponent <ItemContainer>() : null;

        ReturnToPreviousPossition();
        if (container != null)
        {
            if (myItemData.ownerContainer != container)
            {
                ItemContainerManager.MoveItem(myItemData, container);
            }
        }
        // Notify the table of this change
        UpdateTable();

        // Make all widgets update their parents
        NGUITools.MarkParentAsChanged(gameObject);
    }
Ejemplo n.º 6
0
 public override void DoAction(ItemData item)
 {
     ItemContainerManager.MoveItem(item, MoveToContainer);
 }
    // Use this for initialization
    void Start()
    {
        ItemData testItemDataOne = CreateTestItemData();

        ItemContainerManager.MoveItem(testItemDataOne, null, TargetContainer);
    }
    public override void DoAction(ItemDataComponent itemObject)
    {
        ItemData itemData = itemObject.GetComponent <ItemDataComponent>().itemData;

        ItemContainerManager.MoveItem(itemData, itemData.ownerContainer, MoveToContainer);
    }
Ejemplo n.º 9
0
 void OnRegisteredtoSession(CloudGoodsUser user)
 {
     ItemContainerManager.RefreshAllPersistentItemContainers();
 }
 void UpdatedStacksCallback(UpdatedStacksResponse response)
 {
     Debug.Log("received items : " + response.UpdatedStackIds.Count);
     ItemContainerManager.RefreshAllPersistentItemContainers();
     Destroy(this.gameObject);
 }