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); } }
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); } }