# layers

> The layers in the controller.

## Definition

* **Type:** Property
* **Namespace:** [UnityEditor.Animations](/engine/6000.5/script-reference/unityeditor/animations.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public AnimatorControllerLayer[] layers { get; set; }
```

### Remarks

It's important to note that the [AnimatorControllerLayer](/engine/6000.5/script-reference/unityeditor/animations/animatorcontrollerlayer.md) are returned as a copy. The array should be set back into the property when changed.

### Examples

```csharp
class ControllerModifier
{
    UnityEditor.Animations.AnimatorController controller;

    public void ModifyLayers(int layerIndex, string newName)
    {
        UnityEditor.Animations.AnimatorControllerLayer[] layers = controller.layers;
        layers[layerIndex].name = newName;
        controller.layers = layers;
    }
}
```
