描述 : 添加一个指定名称的动画剪辑。

    参数 : addLoopFrame

    描述 : 在firstFrame和lastFrame之间添加动画剪辑,新的动画剪辑也会被添加到名称为newName的动画中。如果已存在具有相同名称的剪辑,会被替换为新剪辑。

    1. using System.Collections;
    2. void Start() {
    3. anim = GetComponent<Animation>();
    4. anim.AddClip(anim.clip, "idle", 21, 30, true);
    5. }