Beispiel #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, progress, completion, scaleFunc);

            t.GameObject = obj;
            t.Renderer   = obj.GetComponent <Renderer>();
            return(t);
        }
Beispiel #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="ease">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, System.Action <ITween <Quaternion> > progress = null, System.Action <ITween <Quaternion> > completion = null, Func <float, float> ease = null)
        {
            if (ease == null)
            {
                ease = TweenScaleFunctions.Linear;
            }
            QuaternionTween t = new QuaternionTween();

            t.Key = key;
            t.Setup(start, end, duration, ease, progress, completion);
            t.Start();
            AddTween(t);

            return(t);
        }