private void DrawMaze() { wallPosArray = maze.GetWallArray(); endWallPos = maze.GetEndWallArray(); startWallPos = maze.GetStartWallArray(); if (MazeMode == MazeGeneratorMode.WithPrefabs) { for (int j = 0; j < wallPosArray.Count; j++) { if (UseStartEndWall) { if (IsPosInArray(wallPosArray[j], endWallPos) && EndWallPrefab != null) { GameObject obj = (GameObject)Instantiate(EndWallPrefab, wallPosArray[j], Quaternion.identity); obj.transform.parent = transform; mazeWalls.Add(obj); } else if (IsPosInArray(wallPosArray[j], startWallPos) && StartWallPrefab != null) { GameObject obj = (GameObject)Instantiate(StartWallPrefab, wallPosArray[j], Quaternion.identity); obj.transform.parent = transform; mazeWalls.Add(obj); } else if (wallPrefab != null) { GameObject obj = (GameObject)Instantiate(wallPrefab, wallPosArray[j], Quaternion.identity); obj.transform.parent = transform; mazeWalls.Add(obj); } } else if (wallPrefab != null) { GameObject obj = (GameObject)Instantiate(wallPrefab, wallPosArray[j], Quaternion.identity); obj.transform.parent = transform; mazeWalls.Add(obj); } } } if (IsCreateGround && groundPrefab != null) { groundObg = (GameObject)Instantiate(groundPrefab, maze.GetPosionForGround(), Quaternion.identity); groundObg.transform.localScale = new Vector3(maze.GetSizeForGround().x, 1, maze.GetSizeForGround().y); groundObg.transform.parent = transform; mazeWalls.Add(groundObg); } if (IsCreateCeiling && ceilingPrefab != null) { ceilingObj = (GameObject)Instantiate(ceilingPrefab, maze.GetPosionForCeiling(), Quaternion.identity); ceilingObj.transform.localScale = new Vector3(maze.GetSizeForGround().x, 1, maze.GetSizeForGround().y); ceilingObj.transform.parent = transform; mazeWalls.Add(ceilingObj); } }