Esempio n. 1
0
        /// <summary>
        /// Sets the ease type (called during Init, but can also be called by Tweener to change easeType while playing).
        /// </summary>
        internal void SetEase(EaseType p_easeType)
        {
            easeType = p_easeType;
            if (easeType == EaseType.AnimationCurve) {
                if (tweenObj._easeAnimationCurve != null) {
                    easeCurve = new EaseCurve(tweenObj._easeAnimationCurve);
                    ease = easeCurve.Evaluate;
                } else {
                    // Missing animation curve: set to normal ease
                    easeType = EaseType.EaseOutQuad;
                    easeInfo = EaseInfo.GetEaseInfo(easeType);
                    ease = easeInfo.ease;
                }
            } else {
                easeInfo = EaseInfo.GetEaseInfo(easeType);
                ease = easeInfo.ease;
            }

            if (_easeReversed && easeInfo.inverseEase != null)
            {
                ease = easeInfo.inverseEase;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new instance of this plugin with the given options.
 /// </summary>
 /// <param name="p_endVal">
 /// The <see cref="object"/> value to tween to.
 /// </param>
 /// <param name="p_easeAnimCurve">
 /// The <see cref="AnimationCurve"/> to use for easing.
 /// </param>
 /// <param name="p_isRelative">
 /// If <c>true</c>, the given end value is considered relative instead than absolute.
 /// </param>
 protected ABSTweenPlugin(object p_endVal, AnimationCurve p_easeAnimCurve, bool p_isRelative)
 {
     isRelative = p_isRelative;
     _endVal = p_endVal;
     easeType = EaseType.AnimationCurve;
     easeCurve = new EaseCurve(p_easeAnimCurve);
     easeInfo = null;
     ease = easeCurve.Evaluate;
 }