private void SpawnHouseInLevel() { levelController = GameObject.Find("LevelController") as GameObject; levelControllerScript = levelController.GetComponent <LevelControllerScript>(); Debug.Log(mapRows); int houseWidth = Random.Range(10, 15); int houseHeight = Random.Range(10, 15); int plotTopLeftCornerX = Random.Range(0, mapCols - (houseWidth + 1)); int plotTopLeftCornerY = Random.Range(0 + houseHeight, mapRows); int orientation = Random.Range(0, 4); int enterWidth = Random.Range(3, 5); int enterHeight = Random.Range(3, 5); for (int i = 0; i < 100; ++i) { levelControllerScript.ReplaceTile(Random.Range(0, mapCols), Random.Range(0, mapRows), woodTile); } for (int i = 0; i < 100; ++i) { levelControllerScript.SpawnItem(Random.Range(0, mapCols), Random.Range(0, mapRows), item); } levelControllerScript.ReplaceTile(5, 5, woodTile); }