Пример #1
0
 /// <summary>
 /// Start and add a Quaternion tween
 /// </summary>
 /// <param name="obj">Game object</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>QuaternionTween</returns>
 public static QuaternionTween Tween(this GameObject obj, object key, Quaternion start, Quaternion end, float duration, Func<float, float> scaleFunc, System.Action<ITween<Quaternion>> progress, System.Action<ITween<Quaternion>> completion = null)
 {
     QuaternionTween 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 Quaternion tween
        /// </summary>
        /// <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>QuaternionTween</returns>
        public static QuaternionTween Tween(object key, Quaternion start, Quaternion end, float duration, Func<float, float> scaleFunc, System.Action<ITween<Quaternion>> progress, System.Action<ITween<Quaternion>> completion = null)
        {
            QuaternionTween t = new QuaternionTween();
            t.Key = key;
            t.Start(start, end, duration, scaleFunc, progress, completion);
            AddTween(t);

            return t;
        }