// add a new key, default interpolation and easeType public void addKey(int _frame, Vector3 _scale) { foreach (AMScaleKey key in keys) { // if key exists on frame, update key if (key.frame == _frame) { AMUtil.recordObject(key, "update key"); key.scale = _scale; // update cache updateCache(); return; } } AMScaleKey a = ScriptableObject.CreateInstance <AMScaleKey>(); a.frame = _frame; a.scale = _scale; a.easeType = (int)AMTween.EaseType.linear; // add a new key AMUtil.recordObject(this, "add key"); keys.Add(a); // update cache updateCache(); }
// copy properties from key public override AMKey CreateClone() { AMScaleKey a = ScriptableObject.CreateInstance <AMScaleKey>(); a.frame = frame; a.scale = scale; a.easeType = easeType; a.customEase = new List <float>(customEase); return(a); }