Esempio n. 1
0
        public GameObject SpawnItem(ItemScheme scheme, Transform parent)
        {
            GameObject itemGO = null;

            if (scheme != null)
            {
                itemGO = GameObject.Instantiate(scheme.itemPrefab, parent);
                if (itemGO != null)
                {
                    var item = itemGO.GetComponent <Item>();
                    if (item != null)
                    {
                        item.Setup(scheme);
                    }
                }
            }
            return(itemGO);
        }
Esempio n. 2
0
        //private void OnDestroy()
        //{
        //	GameplayManager.GetGameplayManager().RemoveFromCachedList(this);
        //}

        public void Setup(ItemScheme scheme)
        {
            this.scheme = scheme;
        }