删除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();
}
}