/// <summary> /// Start and add a Vector2 tween /// </summary> /// <param name="obj">Game object</param> /// <param name="key">Key</param> /// <param name="start">Start value</param> /// <param name="end">End value</param> /// <param name="duration">Duration in seconds</param> /// <param name="scaleFunc">Scale function</param> /// <param name="progress">Progress handler</param> /// <param name="completion">Completion handler</param> /// <returns>Vector2Tween</returns> public static Vector2Tween Tween(this GameObject obj, object key, Vector2 start, Vector2 end, float duration, Func<float, float> scaleFunc, System.Action<ITween<Vector2>> progress, System.Action<ITween<Vector2>> completion = null) { Vector2Tween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion); t.GameObject = obj; t.Renderer = obj.GetComponent<Renderer>(); return t; }
/// <summary> /// Start and add a Vector2 tween /// </summary> /// <param name="key">Key</param> /// <param name="start">Start value</param> /// <param name="end">End value</param> /// <param name="duration">Duration in seconds</param> /// <param name="scaleFunc">Scale function</param> /// <param name="progress">Progress handler</param> /// <param name="completion">Completion handler</param> /// <returns>Vector2Tween</returns> public static Vector2Tween Tween(object key, Vector2 start, Vector2 end, float duration, Func<float, float> scaleFunc, System.Action<ITween<Vector2>> progress, System.Action<ITween<Vector2>> completion = null) { Vector2Tween t = new Vector2Tween(); t.Key = key; t.Start(start, end, duration, scaleFunc, progress, completion); AddTween(t); return t; }