IEnumerator CreateWorld() { TerrainGenerator.instance.ResetTerrain(); if (order == StartOrder.Village) { VG.Generate(); yield return(new WaitForSeconds(1f)); QG.data = VG.CreateData(); //Quest stuff here QG.Generate(); QG.ConfigureQuest(); } else { QG.Generate(); VG.data = QG.CreateData(); //quest stuff here VG.Generate(); yield return(new WaitForSeconds(1f)); QG.g.abstactedData = VG.CreateData(); //this line should probably be replaced by some other way to save? the spawned locations and pass them back rather then juct making sure they are spawned? yield return(new WaitForEndOfFrame()); //pass back to the quest generator QG.ConfigureQuest(); } yield return(new WaitForSeconds(1f)); //show level sceen fade.CrossFadeAlpha(0f, 1.5f, false); yield return(new WaitForSeconds(1.5f)); VG.RunAnimations(); yield return(new WaitForSeconds(12.5f)); //fade to black fade.CrossFadeAlpha(1f, 1.5f, false); yield return(new WaitForSeconds(1.5f)); LoadPlayerIntoWorld(); meshBuilder.UpdateNavMesh(true); foreach (Spawner s in Boids) { s.Run(); } FindObjectOfType <BoidManager>().StartBoids(); yield return(new WaitForSeconds(.5f)); VG.StartNPCs(); //fade in yield return(new WaitForSeconds(.5f)); fade.CrossFadeAlpha(0f, 1.5f, false); QG.DisplayQuest(); miniMap.CanStart(); }