Beispiel #1
0
        public ItemGamePlay GetItem(Transform spawnPoint)
        {
            ItemGamePlay _item = null;

            if (allItems.Count(item => !item.gameObject.activeSelf) > 0)
            {
                _item = allItems.Where(item => !item.gameObject.activeSelf).First();
            }
            else
            {
                allItems.Add(_item = Instantiate(prefabsItem, spawnPoint));
            }

            return(SetItem(_item));
        }
Beispiel #2
0
        ItemGamePlay SetItem(ItemGamePlay item)
        {
            totalItem++;
            int _slot = CheckRateSpawn();

            if ((totalItem > 0 && totalItem % itemSpawnPerOnceObstacle == 0))
            {
                item.SetItem(ItemGamePlayData.detailObstacleObjects[_slot].itemType, ItemGamePlayData.detailObstacleObjects[_slot].eTypeObject, ItemGamePlayData.detailObstacleObjects[_slot].icon);
            }
            else
            {
                item.SetItem(ItemGamePlayData.detailItemObjects[_slot].itemType, ItemGamePlayData.detailItemObjects[_slot].eTypeObject, ItemGamePlayData.detailItemObjects[_slot].icon);
            }

            return(item);
        }