Example #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;
            }
        }
Example #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_easeType">
 /// The <see cref="EaseType"/> to use.
 /// </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, EaseType p_easeType, bool p_isRelative)
 {
     isRelative = p_isRelative;
     _endVal    = p_endVal;
     easeType   = p_easeType;
     easeInfo   = EaseInfo.GetEaseInfo(p_easeType);
     ease       = easeInfo.ease;
 }
Example #3
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;
 }
Example #4
0
            public EaseInfo(Func <float, float, float> easeFunc, string path, int sort = 0)
            {
                Ease  = easeFunc;
                Path  = path;
                _sort = sort;

                if (Default == null || Default._sort > sort)
                {
                    Default = this;
                }

                Debug.Log($"[MSS] [Eases] Registered: {easeFunc.Method.Name} in {path}");
            }
		/// <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;
				}
		}
		/// <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;
		}
		/// <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_easeType">
		/// The <see cref="EaseType"/> to use.
		/// </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, EaseType p_easeType, bool p_isRelative)
		{
				isRelative = p_isRelative;
				_endVal = p_endVal;
				easeType = p_easeType;
				easeInfo = EaseInfo.GetEaseInfo (p_easeType);
				ease = easeInfo.ease;
		}