Ejemplo n.º 1
0
        /// <summary>
        /// Start and add a Vector4 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>Vector4Tween</returns>
        public static Vector4Tween Tween(this GameObject obj, object key, Vector4 start, Vector4 end, float duration, Func <float, float> scaleFunc, System.Action <ITween <Vector4> > progress, System.Action <ITween <Vector4> > completion = null)
        {
            Vector4Tween t = TweenFactory.Tween(key, start, end, duration, progress, completion, scaleFunc);

            t.GameObject = obj;
            t.Renderer   = obj.GetComponent <Renderer>();
            return(t);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Start and add a Vector4 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="ease">Scale function</param>
        /// <param name="progress">Progress handler</param>
        /// <param name="completion">Completion handler</param>
        /// <returns>Vector4Tween</returns>
        public static Vector4Tween Tween(object key, Vector4 start, Vector4 end, float duration, System.Action <ITween <Vector4> > progress = null, System.Action <ITween <Vector4> > completion = null, Func <float, float> ease = null)
        {
            if (ease == null)
            {
                ease = TweenScaleFunctions.Linear;
            }
            Vector4Tween t = new Vector4Tween();

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

            return(t);
        }