Exemple #1
0
    public void RebuildFloor(int startX, int endX, int startZ, int endZ)
    {
        for (int i = startX / map.ChunkSize; i <= endX / map.ChunkSize; i++)
        {
            for (int j = startZ / map.ChunkSize; j <= endZ / map.ChunkSize; j++)
            {
                ChunkDrawer chunk = GameObject.Find("chunk_" + activeLevel + "_" + i + "_" + j).GetComponent <ChunkDrawer>();
                chunk.BuildMesh();
            }
        }

        map.IsDirty = true;
    }
Exemple #2
0
    public IEnumerator RebuildFloor(int startX, int endX, int startZ, int endZ, int level)
    {
        for (int i = startX / map.ChunkSize; i <= endX / map.ChunkSize; i++)
        {
            for (int j = startZ / map.ChunkSize; j <= endZ / map.ChunkSize; j++)
            {
                ChunkDrawer chunk = GameObject.Find("chunk_" + level + "_" + i + "_" + j).GetComponent <ChunkDrawer>();
                chunk.BuildMesh();
                yield return(null);
            }
        }

        map.IsDirty = true;
    }