- Home /
Accessing terrain data ASSET from editor script?
From an editor script, I'd like to access a terrain's terrain data ASSET (just to rename and move it into a different folder). I can easy get a reference to the terrain data class itself through the terrain gameObject, but how could I get a reference to the actual .asset?
Answer by mStep · Sep 24, 2019 at 05:51 PM
Well I found it, you can grab the asset through the instance ID.
Something like:
string terrainDataPath = AssetDatabase.GetAssetPath (EditorUtility.InstanceIDToObject (t.terrainData.GetInstanceID ()));
Mystery solved :)
Your answer

Follow this Question
Related Questions
terrainData.SetHeightsDelayLOD seem to have no effect and i dont know why. 1 Answer
What causes this terrain behavior? 1 Answer
copy smaller size terrain's data, and seet the heights on bigger Terrain at click position 0 Answers
How to export heightmap of a terrain during runtime. 0 Answers
Convert player world position into terrain detail layer coordinates (GetDetailLayer) 2 Answers