i want to change the TerrainData assigned by the terrain component, how to do that in unity editor?
Easiest way is to just drag the new Terrain asset into your scene, which creates a fresh Terrain instance.
Otherwise I think you need to just write a little editor script for it. Be sure to dirty the Terrain so it gets written to disk.
Here’s a script that can match the height of a terrain to arbitrary colliders. It might have some interesting snippets in it for you.
Source code:
