unity, 删除animationClip中的position曲线

删除clip中所有的position曲线:

using UnityEngine;
using System.Collections;
using UnityEditor;
public class removePositionCurves : MonoBehaviour {

public AnimationClip m_aniClip;
    void Start () {
        EditorCurveBinding[] curveBindings= AnimationUtility.GetCurveBindings (m_aniClip);
        for (int i = 0; i < curveBindings.Length; i++) {
            EditorCurveBinding curveBinding = curveBindings [i];
            Debug.Log(curveBinding.path);
            Debug.Log (curveBinding.propertyName);
            if (curveBinding.propertyName.Contains ("m_LocalPosition")) {
                AnimationUtility.SetEditorCurve (m_aniClip, curveBinding, null); 
            }
        }

  AssetDatabase.SaveAssets();
    }

}

上一篇:纯js实现轮播图效果


下一篇:C++抽象类的继承