public static int AddItemToPool(Item item, Vector2 position, int rotation) { item.GetComponent <Collider>().enabled = true; item.SetUniqueID(LastItemId); item.SetLevel(1); item.SetPosition(position); item.SetHP(item.GetMaxHP()); item.transform.SetParent(staticItemPool.transform); ItemPool[LastItemId] = new PooledItem(item, rotation); Managers.Factory.CheckOnFactory(item); TowerManager.CheckOnTower(item); SaveItemToDatabase(item.GetID()); PayForItem(item.GetID()); return(LastItemId++); }