private void InitializeEaseCurve() { EaseCurve.AddKey(0, DefaultEaseCurveValue); EaseCurve.AddKey(1, DefaultEaseCurveValue); OnEaseCurveUpdated(); }
/// <summary> /// Add a new key to ease curve. Value will be read from existing /// curve. /// </summary> /// <param name="time"></param> public void AddKeyToEaseCurve(float time) { var valueAtTime = EaseCurve.Evaluate(time); EaseCurve.AddKey(time, valueAtTime); OnEaseCurveUpdated(); }
public void UpdateEaseValue(int keyIndex, float newValue) { var keyframeCopy = EaseCurve.keys[keyIndex]; // Update keyframe value. keyframeCopy.value = newValue; // Replace old key with updated one. EaseCurve.RemoveKey(keyIndex); EaseCurve.AddKey(keyframeCopy); OnEaseCurveUpdated(); }