protected void SpawnObject() { ISpawnebleObject obj = GetFromPool(); if (obj != null) { obj.SetStartPosition(GetSpawnPosition()); } }
protected ISpawnebleObject CreateObj() { GameObject newObj = Instantiate(objectPrefab); ISpawnebleObject spawnableObj = newObj.GetComponent <ISpawnebleObject>(); if (spawnableObj != null) { objectPool.Add(spawnableObj); return(spawnableObj); } return(null); }