예제 #1
0
        public virtual void AddedItem(OwnedItemInformation itemData, bool isSaving)
        {
            GameObject      newItem    = GameObject.Instantiate(CloudGoodsSettings.DefaultUIItem) as GameObject;
            ItemDataDisplay newDisplay = newItem.GetComponent <ItemDataDisplay>();

            newDisplay.itemObject = newItem.GetComponent <ItemDataComponent>();
            newItem.GetComponent <ItemDataComponent>().itemData = itemData;
            newItem.name = itemData.Information.Name;
            newItem.transform.SetParent(ChildTarget);
            newItem.transform.localPosition = Vector3.zero;
            newItem.transform.localScale    = Vector3.one;
            currentDisplayObjects.Add(newDisplay);
        }
예제 #2
0
        public virtual void RemovedItem(OwnedItemInformation itemData, int amount, bool arg3)
        {
            ItemDataDisplay selected = FindDisplayMatch(itemData);

            if (selected != null)
            {
                if (itemData.Amount <= 0)
                {
                    currentDisplayObjects.Remove(selected);
                    Destroy(selected.gameObject);
                }
            }
        }
예제 #3
0
    public virtual void RemovedItem(ItemData itemData, int amount, bool arg3)
    {
        Debug.Log("removed item: " + itemData);

        ItemDataDisplay selected = FindDisplayMatch(itemData);

        if (selected != null)
        {
            if (itemData.stackSize <= 0)
            {
                currentDisplayObjects.Remove(selected);
                Destroy(selected.gameObject);
            }
        }
    }