# SetTerrainLayersRegisterUndo(TerrainLayer[], string)

> This function sets the TerrainData.terrainLayers property, and in addition, registers the action to the Editor's undo stack.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.TerrainModule

```csharp
public void SetTerrainLayersRegisterUndo(TerrainLayer[] terrainLayers, string undoName)
```

### Parameters

**** (\[TerrainLayer\[]]\(/engine/6000.0/script-reference/unityengine/terrainlayer)): The Terrain Layer assets to set.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the Editor's undo action.

### Remarks

This function is only available in the Editor.
