Animations.AnimatorController.layers

Unity · Версия 2020.3 LTS · Scripting · AnimatorController

Animations.AnimatorController.layers

public AnimatorControllerLayer[] layers;

Описание

Слои в контроллере.

Важно отметить, что AnimatorControllerLayer возвращается как копия. При изменении массив должен быть возвращен в свойство.

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;
    }
}

Обновлено 17 ноября 2026 г.