示例#1
0
 /// <summary>
 /// Start and add a Vector3 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>Vector3Tween</returns>
 public static Vector3Tween Tween(this GameObject obj, object key, Vector3 start, Vector3 end, float duration, Func<float, float> scaleFunc, System.Action<ITween<Vector3>> progress, System.Action<ITween<Vector3>> completion = null)
 {
     Vector3Tween t = TweenFactory.Tween(key, start, end, duration, scaleFunc, progress, completion);
     t.GameObject = obj;
     t.Renderer = obj.GetComponent<Renderer>();
     return t;
 }
示例#2
0
        /// <summary>
        /// Start and add a Vector3 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>Vector3Tween</returns>
        public static Vector3Tween Tween(object key, Vector3 start, Vector3 end, float duration, Func<float, float> scaleFunc, System.Action<ITween<Vector3>> progress, System.Action<ITween<Vector3>> completion = null)
        {
            Vector3Tween t = new Vector3Tween();
            t.Key = key;
            t.Start(start, end, duration, scaleFunc, progress, completion);
            AddTween(t);

            return t;
        }