Example #1
0
        private void InitializeEaseCurve()
        {
            EaseCurve.AddKey(0, DefaultEaseCurveValue);
            EaseCurve.AddKey(1, DefaultEaseCurveValue);

            OnEaseCurveUpdated();
        }
Example #2
0
        /// <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();
        }
Example #3
0
        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();
        }