Example #1
0
 public static void killTween(this Transform target_transform, bool is_complete = false)
 {
     if (target_transform != null)
     {
         MyTweenComponent my_tween = target_transform.gameObject.GetComponent <MyTweenComponent>();
         if (my_tween != null)
         {
             my_tween.stopTween(is_complete);
         }
     }
 }
Example #2
0
        public static void tween(this Transform target_transform, Vector3 local_position, Quaternion local_rotation, Vector3 local_scale, float duration, MyTween.EaseType ease_type = MyTween.EaseType.OUT_QUAD)
        {
            if (target_transform != null)
            {
                MyTweenComponent my_tween = target_transform.gameObject.GetComponent <MyTweenComponent>();
                if (my_tween == null)
                {
                    my_tween = target_transform.gameObject.AddComponent <MyTweenComponent>();
                    my_tween._init(target_transform);
                }

                my_tween.tween(local_position, local_rotation, local_scale, duration, ease_type);
            }
        }
Example #3
0
        public static void tweenToParent(this Transform target_transform, Transform parent_transform, float duration, MyTween.EaseType ease_type = MyTween.EaseType.OUT_QUAD)
        {
            if (target_transform != null)
            {
                MyTweenComponent my_tween = target_transform.gameObject.GetComponent <MyTweenComponent>();
                if (my_tween == null)
                {
                    my_tween = target_transform.gameObject.AddComponent <MyTweenComponent>();
                    my_tween._init(target_transform);
                }

                my_tween.tweenToParent(parent_transform, duration, ease_type);
            }
        }