コントローラーのレイヤー
重要なことは 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;
}
}