public void WangTilesAlgorthim() { for (int i = 0; i < mapChunks.Count; i++) { m_north = eChunkEdgeTypes.NON; m_east = eChunkEdgeTypes.NON; m_south = eChunkEdgeTypes.NON; m_west = eChunkEdgeTypes.NON; if (mapChunks[i].northChunk != null) { if (mapChunks[i].northChunk.myChunk != null) { m_north = mapChunks[i].northChunk.myChunk.south; } } if (mapChunks[i].eastChunk != null) { if (mapChunks[i].eastChunk.myChunk != null) { m_north = mapChunks[i].eastChunk.myChunk.west; } } if (mapChunks[i].southChunk != null) { if (mapChunks[i].southChunk.myChunk != null) { m_north = mapChunks[i].southChunk.myChunk.north; } } if (mapChunks[i].westChunk != null) { if (mapChunks[i].westChunk.myChunk != null) { m_north = mapChunks[i].westChunk.myChunk.east; } } ToPickSetUP(m_north); ToPickSetUP(m_east); ToPickSetUP(m_south); ToPickSetUP(m_west); } }
public void ToPickSetUP(eChunkEdgeTypes type) { switch (type) { case eChunkEdgeTypes.WHITE: foreach (GameObject chunk in mapChunks[0].northChunks.white) { m_toPick.Add(chunk); } return; case eChunkEdgeTypes.RED: foreach (GameObject chunk in mapChunks[0].northChunks.red) { m_toPick.Add(chunk); } return; case eChunkEdgeTypes.GREEN: foreach (GameObject chunk in mapChunks[0].northChunks.green) { m_toPick.Add(chunk); } return; case eChunkEdgeTypes.BLUE: foreach (GameObject chunk in mapChunks[0].northChunks.blue) { m_toPick.Add(chunk); } return; } Debug.LogError("INVALID CHUNK TYPE PASSED"); return; }