Ooook after experimenting with the code i find my answer.
Instantiate(waveConfig.GetEnemyPrefab(),
waveConfig.GetWaypoints()[0].transform.position,
Quaternion.identity);
I know this is the code what instatiates the enemy plane ,what confused me is that if we assigns this to a variable newEnemy
var newEnemy = Instantiate(
waveConfig.GetEnemyPrefab(),
waveConfig.GetWaypoints()[0].transform.position,
Quaternion.Euler(0,0,180));
then this will still create the gameobject and instantiates the plane.So if i understand now correctly when we create this new variable newEnemy we are creating a new gameObject which will instantiate the plane?
Its like this example:
GameObject pathPrefab;
GameObject laserPrefab;
OR
GameObject newEnemy = Instantiate(
waveConfig.GetEnemyPrefab(),
waveConfig.GetWaypoints()[0].transform.position,
Quaternion.Euler(0,0,180));
For me it seems the same