public static Tween Create(Tween.Config config, Func <float, float> easeFunction, Action <Tween> updateCallback, Action <Tween> finishCallback) { if (root == null) { root = new GameObject("TweenManager", typeof(TweenManager)); DontDestroyOnLoad(root.gameObject); } if (tweens == null) { tweens = new Dictionary <string, Tween> (); } Tween tween = new Tween(config, easeFunction, updateCallback, finishCallback); string uniqueId = tween.CurrentConfig.UniqueId; if (tweens.ContainsKey(uniqueId)) { tweens[uniqueId].Stop(Tween.StopAction.DoNothing); tweens.Remove(uniqueId); } tweens.Add(uniqueId, tween); return(tween); }
public static Tween Create(Tween.Config config, Easings.All easeType, Action <Tween> updateCallback, Action <Tween> finishCallback) { return(Create(config, Easings.Functions[easeType], updateCallback, finishCallback)); }
public static Tween Create(Tween.Config config, AnimationCurve animationCurve, Action <Tween> updateCallback, Action <Tween> finishCallback) { return(Create(config, animationCurve.Evaluate, updateCallback, finishCallback)); }