예제 #1
0
    IEnumerator LoadBundleCoroutine()
    {
        while (true)
        {
            bool          isAddable = true;
            CItemDatabase data      = CAssetBundleManager.GetItemDatabase();
            Sprite        sprite    = CAssetBundleManager.GetUISprite("ore_diamond");

            //foreach (CItemDatabase dat in datList)
            //{
            //    if (dat.Equals(data))
            //    {
            //        isAddable = false;
            //        break;
            //    }
            //}

            if (isAddable)
            {
                Debug.Log("데이터넣음");
                datList.Add(data);
            }

            isAddable = true;

            foreach (Sprite spr in sprList)
            {
                if (spr.Equals(sprite))
                {
                    isAddable = false;
                    break;
                }
            }

            if (isAddable)
            {
                Debug.Log("데이터넣음");
                sprList.Add(sprite);
            }

            yield return(null);
        }
    }
예제 #2
0
    public void UpdateItem(CItem item)
    {
        this.item = item;

        if (item != null)
        {
            _icon.color  = Color.white;
            _icon.sprite = CAssetBundleManager.GetUISprite(item.iconPath);
            if (_icon.sprite == null)
            {
                _icon.color = Color.clear;
            }
        }
        else
        {
            _icon.color = Color.clear;
        }

        if (isCraftingSlot)
        {
            _craftingSlot.UpdateRecipe();
        }
    }