private void Start() { leftSpawnerScript = leftSpawner.GetComponent <PlatformSpawner>(); rightSpawnerScript = rightSpawner.GetComponent <PlatformSpawner>(); lastPlatform = SpawnedPlatform.Right; isFirstTime = true; }
private void SpawnPlatform() { if (lastPlatform == SpawnedPlatform.Right) { leftSpawnerScript.Spawn(); lastPlatform = SpawnedPlatform.Left; isFirstTime = false; return; } if (lastPlatform == SpawnedPlatform.Left) { rightSpawnerScript.Spawn(); lastPlatform = SpawnedPlatform.Right; isFirstTime = false; return; } }