Removing Grass?

I see that you can remove trees from the terrain (http://forum.unity3d.com/threads/28855-Destroyable-Trees) but is there any way to remove the grass through code?

Answered my own question. Here is a rough code snippit:

DetailPrototype dp = new DetailPrototype();
dp.prototypeTexture = textures[0].diffuseMap;
dp.maxHeight = 5f;
dp.maxWidth = 5f;
dp.renderMode = DetailRenderMode.Grass;

// Add grass textures to the list
DetailPrototype[ ] dpL = new DetailPrototype[1];
dpL[0] = dp;
// dpL[1] = dp;
mTerrain.terrainData.detailPrototypes = dpL;
int[,] details = new int[10,5];
for (int x = 0; x < 9; x += 2)
{
details[x, 0] = 1;
details[x+1, 0] = 0;

details[x, 4] = 1;
details[x+1, 4] = 1;
}

mTerrain.terrainData.SetDetailLayer(0, 0, 0, details);
// You should see little bits of grass at 0, 0 on the terrain.

This was awesome and totally worked for me for removing grass as a tractor drove over the grass. But now I want to change the texture on the terrain, I have tried a couple of ways using this code to help but I can’t get it to work. Anyone have any suggestions?

Can you be more specific about this code??

Excuse me can you explain this code and how you use this code?

Here is some research you may want to look into, it should give you the general idea of whats happening :slight_smile: