Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #3
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));
        }
Beispiel #4
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));
        }
Beispiel #5
0
        public BaseTween ValueTween(float from, float to, float t)
        {
            var tween = TweenPool.GetValueTween(from, to, t);

            return(ProcessTween(tween));
        }