// Normal Way 3 private IEnumerator ContinueGeneration() { //Find farest North, South, West and East room for each biome FindBiomesExtremeRooms(); //Spawn tiles for (int i = 0; i < myBiomes.Length; i++) { myBiomes[i].InstantiateRoom(); while (!myBiomes[i].myGenerationDone) { yield return(null); } } //Link biomes with room LinkBiomesWithRooms(); //Create physic link between biomes for (int i = 0; i < myBiomes.Length; i++) { myBiomes[i].AffectNextRoomsTriggers(); } //Remove all empty transitions for (int i = 0; i < myBiomes.Length; i++) { myBiomes[i].RemoveAllEmptyTransitions(); } //Spawn NPC //Create Quests CheckWallsSurrounding(); ChangeTileRendering(); SpawnResources(); SpawnDecoration(); SpawnEnemies(); for (int i = 0; i < myBiomes.Length; i++) { myBiomes[i].HideRooms(); } myCurrentActiveBiome = myBiomes[0]; myCurrentActiveBiome.gameObject.SetActive(true); myCurrentActiveBiome.GetStartingRoom().gameObject.SetActive(true); SpawnPlayer(); FadeManager.GetInstance().LaunchBeginTransition(); }
public void PlacePlayer() { Room myStartingRoom = myCurrentActiveBiome.GetStartingRoom(); myPlayerMovement.transform.position = myStartingRoom.GetMidTile().transform.position + Vector3.forward * -0.05f; MapUI mapUI = myPlayerMovement.GetComponentInChildren <MapUI>(); mapUI.Init(); mapUI.SetRoomVisited(myStartingRoom.myRoomData.myX, myStartingRoom.myRoomData.myY); myPlayerMovement.SetCurrentRoom(myStartingRoom); }