public Raven poolRaven() { if (ravenPool.Count == 0) { GameObject newObject = Instantiate(raven_prefab); Raven newRaven = newObject.GetComponent <Raven>(); newRaven.setPrefabBank(this); newRaven.setEnemyManager(enemyManager); newRaven.setFruitManager(fruitManager); newRaven.setTree(tree); newRaven.gameObject.SetActive(true); return(newRaven); } else { Raven newRaven = ravenPool.Pop(); newRaven.gameObject.SetActive(true); return(newRaven); } }