public static A Tween <T, V, A>(this T subject, V target, Tweener.BlendType blend, float time, float delay = 0, Func <double, double> easing = null, Action callback = null) where A : TweenData <T, V> where T : Component { A tween = Construct <T, V, A>(subject, target, time, delay, easing, callback); return(AttachComponentTween <A, T, V>(subject.gameObject, tween, blend)); }
private static A AttachComponentTween <A, T, V> (GameObject gameObject, A tween, Tweener.BlendType blend) where A : TweenData <T, V> { if (!gameObject) { return(null); } Tweener tweenComponent = gameObject.GetComponent <Tweener>(); if (!tweenComponent) { tweenComponent = gameObject.AddComponent <Tweener>(); } tweenComponent.Add <A, T, V>(tween, blend); return(tween); }