TerrainChunk.Edit C# (CSharp) Method

Edit() public method

public Edit ( int x, int y ) : void
x int
y int
return void
    public void Edit(int x, int y)
    {
        var newVT = VoxelType.Empty;
        int voxIndex = x + y * CHUNK_VOXELS_DIM;
        if (voxIndex < 0 || voxIndex >= CHUNK_VOXELS_DIM * CHUNK_VOXELS_DIM) {
            return;
        }
        if (voxels[voxIndex].vtype != newVT) {
            voxels[voxIndex].vtype = newVT;
            RebuildMesh();
        }
    }