Esempio n. 1
0
        internal BaseTween SetFloatProperty(Material material, int propertyHash, float value, float t)
        {
            ValueTween tween = TweenPool.GetValueTween(material.GetFloat(propertyHash), value, t);

            tween.SetOnUpdateFloat(v => material.SetFloat(propertyHash, v));
            return(ProcessTween(tween));
        }
Esempio n. 2
0
        public BaseTween Fade(CanvasGroup cg, float to, float t)
        {
            ValueTween tween = TweenPool.GetValueTween(cg.alpha, to, t);

            tween.SetOnUpdateFloat(delegate(float v)
            {
                if (cg == null)
                {
                    CancelTween(tween);
                    return;
                }

                cg.alpha = v;
            });
            return(ProcessTween(tween));
        }
        public BaseTween Fade(CanvasGroup cg, float to, float t)
        {
            ValueTween tween = new ValueTween(cg.alpha, to, t, GenerateId());

            tween.SetOnUpdateFloat(delegate(float v)
            {
                if (cg == null)
                {
                    tweens.Remove(tween);
                    return;
                }

                cg.alpha = v;
            });
            return(ProcessTween(tween));
        }
Esempio n. 4
0
        public static ValueTween GetValueTween(float start, float end, float t)
        {
            ValueTween tween;

            if (TryGetTween(valueTweens, out tween))
            {
                tween.Reset();
                tween.Init(start, end, t);
            }
            else
            {
                tween = new ValueTween(start, end, t, GenerateId());
            }

            _activeTweens.Add(tween);
            return(tween);
        }
Esempio n. 5
0
        public BaseTween Fade(SpriteRenderer sprite, float to, float t)
        {
            ValueTween tween = TweenPool.GetValueTween(sprite.color.a, to, t);

            tween.SetOnUpdateFloat(delegate(float v)
            {
                if (sprite == null)
                {
                    CancelTween(tween);
                    return;
                }

                Color c      = sprite.color;
                c.a          = v;
                sprite.color = c;
            });
            return(ProcessTween(tween));
        }
Esempio n. 6
0
        public BaseTween Fade(Image image, float to, float t)
        {
            ValueTween tween = TweenPool.GetValueTween(image.color.a, to, t);

            tween.SetOnUpdateFloat(v =>
            {
                if (image == null)
                {
                    CancelTween(tween);
                    return;
                }

                Color c     = image.color;
                c.a         = v;
                image.color = c;
            });
            return(ProcessTween(tween));
        }
        public BaseTween Fade(SpriteRenderer sprite, float to, float t)
        {
            ValueTween tween = new ValueTween(sprite.color.a, to, t, GenerateId());

            tween.SetOnUpdateFloat(delegate(float v)
            {
                if (sprite == null)
                {
                    tweens.Remove(tween);
                    return;
                }

                Color c      = sprite.color;
                c.a          = v;
                sprite.color = c;
            });
            return(ProcessTween(tween));
        }
        public BaseTween Fade(Image image, float to, float t)
        {
            ValueTween tween = new ValueTween(image.color.a, to, t, GenerateId());

            tween.SetOnUpdateFloat(delegate(float v)
            {
                if (image == null)
                {
                    tweens.Remove(tween);
                    return;
                }

                Color c     = image.color;
                c.a         = v;
                image.color = c;
            });
            return(ProcessTween(tween));
        }
Esempio n. 9
0
        public BaseTween ValueTween(float from, float to, float t)
        {
            ValueTween tween = new ValueTween(from, to, t, GenerateId());

            return(ProcessTween(tween));
        }