Esempio n. 1
0
    public void AddMyItmeToInven(int itemIndex, int itemCount)
    {
        for (int n = 0; n < _myItemList.Count; n++)
        {
            if (_myItemList[n]._MyItemIndex == itemIndex)
            {
                _myItemList[n].RenewItem(itemCount);
                return;
            }
        }

        GameObject prefabMyItem = ResourcePoolManager._instance.GetObj <GameObject>(ResourcePoolManager.eResourceKind.Prefab, "MyItem") as GameObject;
        MyItem     myItem       = Instantiate(prefabMyItem, _invenTr).GetComponent <MyItem>();

        myItem.InitItem(itemIndex, itemCount);
        _myItemList.Add(myItem);
    }