Пример #1
0
        public ZTweener Tween(object from, object to, float duration)
        {
            ZTweener tw = null;

            if (to is float)
            {
                tw = ZTween.Tween(Getter, Setter, (float)to, duration);
                if (from != null)
                {
                    value = (float)from;
                    tw.StartFrom(value);
                }
            }

            if (tw != null)
            {
                tw.SetTag(this);
            }
            return(tw);
        }
Пример #2
0
        public ZTweener Tween(object from, object to, float duration)
        {
            ZTweener tw = null;

            if (to is Color)
            {
                tw = ZTween.Tween(ColorGetter, ColorSetter, (Color)to, 0f);
                if (from is Color)
                {
                    color = (Color)from;
                    tw.StartFrom(color);
                }
            }

            if (tw != null)
            {
                tw.SetTag(this);
            }
            return(tw);
        }
Пример #3
0
        public ZTweener Tween(object from, object to, float duration)
        {
            ZTweener tw = null;

            if (to is Color)
            {
                tw = this.TweenColor((Color)to, duration);
                if (from is Color)
                {
                    tw.StartFrom((Color)from);
                }
            }
            else if (to is float)
            {
                tw = this.TweenAlpha((float)to, duration);
                if (from is float)
                {
                    var fromColor = color;
                    fromColor.a = (float)from;
                    color       = fromColor;
                    tw.StartFrom(color);
                }
            }
            else if (to is Vector2)
            {
                tw = ZTween.Tween(GetUVOffset, SetUVOffset, (Vector2)to, duration);
                if (from is Vector2)
                {
                    tw.StartFrom((Vector2)from);
                }
            }
            else if (to is Vector4)
            {
            }
            if (tw != null)
            {
                tw.SetTag(this);
            }
            return(tw);
        }
Пример #4
0
 public void TweenColor(Color to)
 {
     ZTween.Stop(this);
     ZTween.Tween(GetColor, SetColor, to, 0.2f).SetTag(this);
 }