示例#1
0
        public static IEnumerator DoEaseFor(float duration, GoEaseType easeType, Action <float> lerpCallback)
        {
            // NOTE (darren): are you serious GoTween...
            Func <float, float, float, float, float> easeFunction = GoTweenUtils.easeFunctionForType(easeType);

            for (float time = 0.0f; time <= duration; time += Time.deltaTime)
            {
                float percentage = easeFunction.Invoke(time, 0, 1, duration);
                lerpCallback.Invoke(percentage);
                yield return(null);
            }

            lerpCallback.Invoke(1.0f);
        }
示例#2
0
 static public int easeFunctionForType_s(IntPtr l)
 {
     try {
         GoEaseType a1;
         checkEnum(l, 1, out a1);
         GoTween a2;
         checkType(l, 2, out a2);
         var ret = GoTweenUtils.easeFunctionForType(a1, a2);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#3
0
 /// <summary>
 /// sets the ease type for this tween property
 /// technically, this should be an internal method
 /// </summary>
 public void setEaseType(GoEaseType easeType)
 {
     _easeFunction = GoTweenUtils.easeFunctionForType(easeType, _ownerTween);
 }
示例#4
0
 /// <summary>
 /// sets the ease type for this tween property
 /// technically, this should be an internal method
 /// </summary>
 public void setEaseType(EaseType easeType)
 {
     _easeFunction = GoTweenUtils.easeFunctionForType(easeType);
 }