Beispiel #1
0
        /// <summary>
        /// Create a TweenScale Component and start a tween
        /// </summary>
        /// <param name="go">GameObject to apply tween too</param>
        /// <param name="duration">Duration of tween</param>
        /// <param name="scale">The ending value for the tween</param>
        /// <param name="finished">A optional Callback to fire when the tween is done</param>
        /// <returns>Return reference to the new TweenScale component</returns>
        public static TweenScale Tween(GameObject go, float duration, Vector3 scale, UnityAction finished = null)
        {
            TweenScale cls = TweenMain.Tween <TweenScale>(go, duration, finished);

            cls.from = cls.value;
            cls.to   = scale;
            cls.Start();
            return(cls);
        }
Beispiel #2
0
        /// <summary>
        /// Create a TweenScale Component, and starts a tween.
        /// </summary>
        /// <param name="go">GameObject to Apply the tween too</param>
        /// <param name="duration">How long the tween will take</param>
        /// <param name="scale">The final Value at the end of the tween</param>
        /// <param name="method">The tweening method</parm>
        /// <param name="finished">The method execute at the end of the tween</param>
        /// <returns>Reference to the TweenScale component</returns>
        public static TweenScale Tween(GameObject go, float duration, Vector3 scale,
                                       Style style = Style.Once, Method method = Method.Linear, UnityAction finished = null, bool newObj = true)
        {
            TweenScale cls = TweenMain.Tween <TweenScale>(go, duration, style, method, finished, newObj);

            cls.from = cls.value;
            cls.to   = scale;
            cls.Start();
            return(cls);
        }
Beispiel #3
0
        /// <summary>
        /// Create a TweenScale Component and start a tween
        /// </summary>
        /// <param name="go">GameObject to apply tween too</param>
        /// <param name="duration">Duration of tween</param>
        /// <param name="fromVal">The starting value for the tween</param>
        /// <param name="toVal">The ending value for the tween</param>
        /// <param name="style">The style of tween (Once, Looped, PingPong)</param>
        /// <param name="method">The Interpolation method of the tween</param>
        /// <param name="finished">A optional Callback to fire when the tween is done</param>
        /// <returns>Return reference to the new TweenScale component</returns>
        public static TweenScale Tween(GameObject go, float duration, Vector3 fromVal, Vector3 toVal,
                                       Style style, Method method, UnityAction finished = null)
        {
            TweenScale cls = TweenMain.Tween <TweenScale>(go, duration, style, method, finished);

            cls.from = fromVal;
            cls.to   = toVal;
            cls.Start();
            return(cls);
        }