// add a new key public void addKey(int _frame, Quaternion _rotation) { foreach (AMRotationKey key in keys) { // if key exists on frame, update key if (key.frame == _frame) { AMUtil.recordObject(key, "update key"); key.rotation = _rotation; // update cache updateCache(); return; } } AMRotationKey a = ScriptableObject.CreateInstance <AMRotationKey>(); a.frame = _frame; a.rotation = _rotation; // set default ease type to linear a.easeType = (int)AMTween.EaseType.linear; // add a new key AMUtil.recordObject(this, "add key"); keys.Add(a); // update cache updateCache(); }
/*public bool setType(int type) { * if(this.type != type) { * this.type = type; * return true; * } * return false; * }*/ // copy properties from key public override AMKey CreateClone() { AMRotationKey a = ScriptableObject.CreateInstance <AMRotationKey>(); a.frame = frame; //a.type = type; a.rotation = rotation; a.easeType = easeType; a.customEase = new List <float>(customEase); return(a); }