private IEnumerator AssimilateCinematically(LevelRoom room, LevelRoom toAssimilate) { LevelRoomMaterials materials = room.mats; foreach (LevelCell cell in toAssimilate.cells) { cell.transform.GetChild(0).GetComponent <Renderer>().material = materials.floorMaterial; cell.twoDImage.color = materials.floorMaterial.color; foreach (LevelCellEdge edge in cell.edges) { if (edge is LevelPassage) { if (edge.image != null) { edge.image.color = materials.floorMaterial.color; } } } foreach (LevelCellEdge edge in cell.edges) { if (edge is LevelWall) { ((LevelWall)(edge)).wall.GetComponent <Renderer>().material = materials.wallMaterial; } else if (edge is LevelBreakableWall) { ((LevelBreakableWall)(edge)).wall.GetComponent <Renderer>().material = breakableMats[room.matIndex]; } } yield return(new WaitForSeconds(0.0f)); } room.Join(toAssimilate); }
private void Assimilate(LevelRoom room, LevelRoom toAssimilate) { LevelRoomMaterials materials = room.mats; foreach (LevelCell cell in toAssimilate.cells) { cell.transform.GetChild(0).GetComponent <Renderer>().material = materials.floorMaterial; cell.twoDImage.color = materials.floorMaterial.color; foreach (LevelCellEdge edge in cell.edges) { if (edge is LevelPassage) { if (edge.image != null) { edge.image.color = materials.floorMaterial.color; } } } foreach (LevelCellEdge edge in cell.edges) { if (edge is LevelWall) { ((LevelWall)(edge)).wall.GetComponent <Renderer>().material = materials.wallMaterial; } else if (edge is LevelBreakableWall) { ((LevelBreakableWall)(edge)).wall.GetComponent <Renderer>().material = breakableMats[room.matIndex]; } } } room.Join(toAssimilate); }