You can use these (undocumented) commands to read and write the terrain detail layers:
So, using the above scripts, you would read the layers, edit the values in the array relating to the details at a particular area, and then write the details back to the terrainData.
Because these functions are undocumented, any future updates of the unity engine might change or remove these functions from the API. This means your project may not work in future versions of the Unity editor, and webplayer builds may not work with future versions of the plugin.
answered Mar 18 '10 at 10:50 AM
I assume you are talking about grass on the built-in terrains in Unity.
You can modify the terrain at runtime. See this Q&A:
You can use that functionality to alter where the grass is on a terrain.
answered Mar 18 '10 at 10:51 AM