@@ -360,7 +360,11 @@ public void BezierInit()
360360 if ( m_fromV3 . z == m_toV3 . z )
361361 {
362362 m_v3Contral [ 0 ] . z = m_fromV3 . z ;
363- m_v3Contral [ 1 ] . z = m_toV3 . z ;
363+ if ( m_v3Contral . Length > 1 )
364+ {
365+ m_v3Contral [ 1 ] . z = m_toV3 . z ;
366+ }
367+
364368 }
365369 }
366370 /// <summary>
@@ -768,28 +772,36 @@ float GetInterpolation(float oldValue, float aimValue)
768772 {
769773 case InterpType . Default :
770774 case InterpType . Linear : return Mathf . Lerp ( oldValue , aimValue , m_currentTime / m_totalTime ) ;
775+
771776 case InterpType . InBack : return InBack ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
772777 case InterpType . OutBack : return OutBack ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
773778 case InterpType . InOutBack : return InOutBack ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
774779 case InterpType . OutInBack : return OutInBack ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
780+
775781 case InterpType . InQuad : return InQuad ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
776782 case InterpType . OutQuad : return OutQuad ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
777783 case InterpType . InoutQuad : return InoutQuad ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
784+
778785 case InterpType . InCubic : return InCubic ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
779786 case InterpType . OutCubic : return OutCubic ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
780787 case InterpType . InoutCubic : return InoutCubic ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
788+ case InterpType . OutInCubic : return OutinCubic ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
789+
781790 case InterpType . InQuart : return InQuart ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
782791 case InterpType . OutQuart : return OutQuart ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
783792 case InterpType . InOutQuart : return InOutQuart ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
784793 case InterpType . OutInQuart : return OutInQuart ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
794+
785795 case InterpType . InQuint : return InQuint ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
786796 case InterpType . OutQuint : return OutQuint ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
787797 case InterpType . InOutQuint : return InOutQuint ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
788798 case InterpType . OutInQuint : return OutInQuint ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
799+
789800 case InterpType . InSine : return InSine ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
790801 case InterpType . OutSine : return OutSine ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
791802 case InterpType . InOutSine : return InOutSine ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
792803 case InterpType . OutInSine : return OutInSine ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
804+
793805 case InterpType . InExpo : return InExpo ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
794806 case InterpType . OutExpo : return OutExpo ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
795807 case InterpType . InOutExpo : return InOutExpo ( oldValue , aimValue , m_currentTime , m_totalTime ) ;
@@ -1013,6 +1025,21 @@ public float InoutCubic(float b, float to, float t, float d)
10131025 return c / 2 * ( t * t * t + 2 ) + b ;
10141026 }
10151027 }
1028+
1029+ public float OutinCubic ( float b , float to , float t , float d )
1030+ {
1031+ float c = to - b ;
1032+
1033+ if ( t < d / 2 )
1034+ {
1035+ return OutCubic ( b , b + c / 2 , t * 2 , d ) ;
1036+ }
1037+ else
1038+ {
1039+ return InCubic ( b + c / 2 , to , ( t * 2 ) - d , d ) ;
1040+ }
1041+ }
1042+
10161043 public float InQuart ( float b , float to , float t , float d )
10171044 {
10181045 float c = to - b ;
0 commit comments