// add a new key public void addKey(int _frame, AnimationClip _clip, WrapMode _wrapMode) { foreach (AMAnimationKey key in keys) { // if key exists on frame, update key if (key.frame == _frame) { AMUtil.recordObject(key, "update key"); key.amClip = _clip; key.wrapMode = _wrapMode; // update cache updateCache(); return; } } AMAnimationKey a = ScriptableObject.CreateInstance <AMAnimationKey>(); a.frame = _frame; a.amClip = _clip; a.wrapMode = _wrapMode; // add a new key AMUtil.recordObject(this, "add key"); keys.Add(a); // update cache updateCache(); }
// copy properties from key public override AMKey CreateClone() { AMAnimationKey a = ScriptableObject.CreateInstance <AMAnimationKey>(); a.frame = frame; a.wrapMode = wrapMode; a.amClip = amClip; a.crossfade = crossfade; return(a); }