Example #1
0
 virtual protected UCL_Tweener CreateTweener()
 {
     Kill();
     m_Tweener = LibTween.Tweener(m_Duration).SetEase(m_Ease);
     if (m_TweenerComponents == null)
     {
         m_TweenerComponents = new List <UCL_TC_Data>();
     }
     for (int i = 0; i < m_TweenerComponents.Count; i++)
     {
         var comp = m_TweenerComponents[i].CreateTweenerComponent();
         m_Tweener.AddComponent(comp);
     }
     m_Tweener.OnComplete(() => { EndTween(true); });
     return(m_Tweener);
 }
Example #2
0
 /// <summary>
 /// Create a Tweener that move iTarget toward iTargetRectTransform,
 /// also scale and rotate to fit iTargetRectTransform
 /// </summary>
 /// <param name="iTarget"></param>
 /// <param name="iTargetRectTransform"></param>
 /// <returns></returns>
 static public UCL_Tweener UCL_RectTransform(this RectTransform iTarget, float iDuration, RectTransform iTargetRectTransform)
 {
     return(LibTween.Tweener(iDuration).AddComponent(iTarget.TC_RectTransform(iTargetRectTransform)));
 }
Example #3
0
 /// <summary>
 /// Move target to target_transform in duration(Second)
 /// </summary>
 /// <param name="target">move target</param>
 /// <param name="duration">duration in second</param>
 /// <param name="target_transform">target position</param>
 /// <returns></returns>
 static public UCL_Tweener UCL_Move(this Transform target, float duration, Transform target_transform)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_Move(target, target_transform)));
 }
Example #4
0
 static public UCL_Tweener UCL_LocalMove(this Transform target, float duration, float x, float y, float z)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_LocalMove(target, x, y, z)));
 }
Example #5
0
 static public UCL_Tweener UCL_LocalMove(this Transform target, float duration, Vector3 target_position)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_LocalMove(target, target_position)));
 }
Example #6
0
 static public UCL_Tweener UCL_ScaleZ(this Transform target, float duration, float val)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_ScaleZ(target, val)));
 }
Example #7
0
 static public UCL_Tweener UCL_Scale(this Transform target, float duration, Vector3 target_scale)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_Scale(target, target_scale)));
 }
Example #8
0
 static public UCL_Tweener UCL_LocalRotate(this Transform target, float duration, Quaternion target_rotation)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_LocalRotate(target, target_rotation)));
 }
Example #9
0
 /// <summary>
 /// Create a Tweener contains TC_EulerRotation
 /// </summary>
 /// <param name="target"></param>
 /// <param name="iDuration"></param>
 /// <param name="iX"></param>
 /// <returns></returns>
 static public UCL_Tweener UCL_RotateByX(this Transform target, float iDuration, float iX)
 {
     return(LibTween.Tweener(iDuration).AddComponent(TC_RotateByX(target, iX)));
 }
Example #10
0
 /// <summary>
 /// Create a Tweener contains TC_EulerRotation
 /// </summary>
 /// <param name="target"></param>
 /// <param name="iDuration"></param>
 /// <param name="iX"></param>
 /// <param name="iY"></param>
 /// <param name="iZ"></param>
 /// <returns></returns>
 static public UCL_Tweener UCL_EulerRotation(this Transform target, float iDuration, float iX, float iY, float iZ)
 {
     return(LibTween.Tweener(iDuration).AddComponent(TC_EulerRotation(target, iX, iY, iZ)));
 }
Example #11
0
 /// <summary>
 /// Create a Tweener contains TC_EulerRotation
 /// </summary>
 /// <param name="target"></param>
 /// <param name="iDuration"></param>
 /// <param name="iRotation"></param>
 /// <returns></returns>
 static public UCL_Tweener UCL_EulerRotation(this Transform target, float iDuration, Vector3 iRotation)
 {
     return(LibTween.Tweener(iDuration).AddComponent(TC_EulerRotation(target, iRotation)));
 }
Example #12
0
 /// <summary>
 /// Create a tweener do TC_LocalShake on target transform
 /// </summary>
 /// <param name="_Range">Max Range of shake</param>
 /// <param name="_ShakeTimes">shaking times</param>
 /// <param name="_fade">shaking will fade if true</param>
 static public UCL_Tweener UCL_LocalShake(this Transform target, float duration, float _Range, int _ShakeTimes, bool _fade = true)
 {
     return(LibTween.Tweener(duration).AddComponent(TC_LocalShake(target, _Range, _ShakeTimes, _fade)));
 }
Example #13
0
 /// <summary>
 /// Create a Tweener contains TC_Jump
 /// </summary>
 /// <param name="iDuration">duration of tweener</param>
 /// <param name="iTarget">Move target</param>
 /// <param name="iTargetPosition">Target position that target will move to</param>
 /// <param name="iJumpTimes">Jump times</param>
 /// <param name="iUp">Up vector of jump , etc. (0,1,0)</param>
 /// <param name="iHeight">Initial Jump height</param>
 /// <param name="iBounciness">Height decade after each jump, if == 1 then the height stay the same each jump</param>
 /// <returns></returns>
 static public UCL_Tweener UCL_Jump(this Transform iTarget, float iDuration, Vector3 iTargetPosition, int iJumpTimes,
                                    Vector3 iUp, float iHeight, float iBounciness)
 {
     return(LibTween.Tweener(iDuration).AddComponent(TC_Jump(iTarget, iTargetPosition, iJumpTimes, iUp, iHeight, iBounciness)));
 }