예제 #1
0
        static public TweenPosition Begin(GameObject go, float duration, Vector3 from, Vector3 to, bool isAnchoredPosition = false, Method moveMethod = Method.Linear)
        {
            TweenPosition comp = UITweener.Begin <TweenPosition>(go, duration);

            comp.anchoredPosition = isAnchoredPosition;
            comp.method           = moveMethod;
            comp.value            = from;
            comp.from             = comp.value;
            comp.to = to;

            if (duration <= 0f)
            {
                comp.Sample(1f, true);
                comp.enabled = false;
            }
            return(comp);
        }
예제 #2
0
        /// <summary>
        /// Start the tweening operation.
        /// </summary>

        static public TweenSpriteColor Begin(GameObject go, float duration, Color color)
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return(null);
            }
#endif
            TweenSpriteColor comp = UITweener.Begin <TweenSpriteColor>(go, duration);
            comp.from = comp.value;
            comp.to   = color;

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