语言英语
  • C#

动画控制器.层

public AnimatorControllerLayer[] 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: