public void Clear() { sectorsDict.Clear(); for (int k = 0; k < sectorsPool.Length; k++) { sectorsPool[k].key = 0; sectorsPool[k].uses = 0; } lastKey = 0; lastSector = -1; }
/// <summary> /// Removes all existing voxels in this chunk. /// </summary> public void ClearVoxels(byte light) { if (lightSources != null) { int lightSourcesCount = lightSources.Count; for (int k = 0; k < lightSourcesCount; k++) { if (lightSources [k].gameObject != null) { DestroyImmediate(lightSources [k].gameObject); } } lightSources.Clear(); } if (placeholders != null) { int phCount = placeholders.Count; for (int k = 0; k < phCount; k++) { if (placeholders.entries [k].key >= 0) { VoxelPlaceholder ph = placeholders.entries [k].value; if (ph != null) { DestroyImmediate(ph.gameObject); } } } placeholders.Clear(); } if (voxelsExtraData != null) { voxelsExtraData.Clear(); } Voxel.Clear(voxels, light); }
public void Clear() { heightSectors.Clear(); lastKey = 0; }