private static void SpawnUnit(GameObjectPool pool, string size) { GameObject enemy = pool.Rent(false); EnemyController enemyComponent = enemy.GetComponent <EnemyController>(); FindParentToSpawn(enemy, size); enemy.transform.position = Vector3.zero; enemy.SetActive(true); EmitOnDisable emitOnDisable = enemy.GetComponent <EmitOnDisable>(); emitOnDisable.OnDisableGameObject += EnemyDisabled; enemyComponent.ResetUnit(path, start, blockSize); activeUnits.Add(enemy); }