文档

Unity Engine

Unity Engine

layers

The layers in the controller.
阅读时间1 分钟最后更新于 1 个月前

Definition

public AnimatorControllerLayer[] layers { get; set; }

Remarks

It's important to note that the AnimatorControllerLayer are returned as a copy. The array should be set back into the property when changed.

Examples

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