控制器中的层。
需要注意,动画控制器层返回为副本。当更改后,该数组应被设定回属性。
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;
}
}