Esempio n. 1
0
        static public TweenTransform Begin(GameObject go, float duration, Transform from, Transform to)
        {
            TweenTransform component = Tween.Begin <TweenTransform>(go, duration);

            component._from = from;
            component._to   = to;

            if (duration <= 0f)
            {
                component.sample(1f, true);
                component.enabled = false;
            }
            return(component);
        }
Esempio n. 2
0
        /// <summary>
        /// Start the tweening operation.
        /// </summary>

        static public TweenTransform Begin(GameObject go, float duration, Transform to)
        {
            TweenTransform component = Tween.Begin <TweenTransform>(go, duration);

            component._fromData          = new TransformData();
            component._fromData.position = component.transform.position;
            component._fromData.scale    = component.transform.lossyScale;
            component._fromData.rotation = component.transform.rotation;
            component._to = to;

            if (duration <= 0f)
            {
                component.sample(1f, true);
                component.enabled = false;
            }
            return(component);
        }