API for GetDetailLayer / SetDetailLayer

I know it’s undocumented and might change, still…

what’s the function definition for terrainData.GetDetailLayer and terrainData.SetDetailLayer?

I’d like to set grass, brushes and rocks the same way I set terrain, through script. I know the API is unstable, undocumented, etc. - I’m writing editor scripts, so I don’t care if it changes tomorrow, my webplayers etc. will still work because I store everything in terrainData.

Just need to know how to modify it.

I already found out that GetDetailLayer expects 5 parameters, but I have no idea how to proceed further in C# - is there a way to find out what types it expects, what it returns?

Or could someone from the Unity team tell? Please? With cookies? I’m doing interesting stuff with this, I know you want to see it… :slight_smile:

I’ll bump this just this once, but…

please?

with sugar?

Anyone know anything about how detail/grass can be accessed, please post. I’m trying to find out myself, but it’s more than a bit tricky.

The Unity terrain engine is written in C#. If you have access to windows, you can simply build a standalone project, open the proper assembly in reflector and look through the terrain engine source for all your undocumented api answers.

Thanks, Quietus. Someone on IRC posted the same suggestion, and indeed that provided the breakthrough.

See “Showcases”. :slight_smile: Yay!