The layers in the controller.
It's important to note that the AnimatorControllerLayer are returned as a copy. The array should be set back into the property when changed.
#pragma strict class ControllerModifier { var controller: UnityEditor.Animations.AnimatorController; public function ModifyLayers(layerIndex: int, newName: String) { var layers: UnityEditor.Animations.AnimatorControllerLayer[] = controller.layers; layers[layerIndex].name = newName; controller.layers = layers; } }
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; } }
Did you find this page useful? Please give it a rating: