コード例 #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));
        }
コード例 #2
0
        public BaseTween ColorTween(Image image, Color to, float t)
        {
            ColorTween tween = TweenPool.GetColorTween(image.color, to, t);

            tween.SetOnUpdateColor(delegate(Color c)
            {
                if (image == null)
                {
                    CancelTween(tween);
                    return;
                }

                image.color = c;
            });
            return(ProcessTween(tween));
        }
コード例 #3
0
        public BaseTween ColorTween(SpriteRenderer sprite, Color to, float t)
        {
            ColorTween tween = TweenPool.GetColorTween(sprite.color, to, t);

            tween.SetOnUpdateColor(delegate(Color c)
            {
                if (sprite == null)
                {
                    TweenPool.FinishTween(tween);
                    return;
                }

                sprite.color = c;
            });
            return(ProcessTween(tween));
        }
コード例 #4
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));
        }
コード例 #5
0
        public BaseTween Move(Transform obj, Vector3 to, float t)
        {
            Vector3Tween tween = TweenPool.GetVector3Tween(obj.position, to, t);

            tween.PauseReset += () => tween.Init(obj.position, to, t);
            tween.SetOnUpdateVector3((Vector3 pos) =>
            {
                if (obj == null)
                {
                    CancelTween(tween);
                    return;
                }

                obj.position = pos;
            });
            return(ProcessTween(tween));
        }
コード例 #6
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));
        }
コード例 #7
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));
        }
コード例 #8
0
        public BaseTween RotateTween(Transform t, Quaternion to, float time)
        {
            QuaternionTween tween = TweenPool.GetQuaternionTween(t.rotation, to, time);

            tween.SetOnUpdateQuaternion(delegate(Quaternion v)
            {
                if (t != null)
                {
                    t.rotation = v;
                }
                else
                {
                    CancelTween(tween);
                }
            });

            return(ProcessTween(tween));
        }
コード例 #9
0
        public BaseTween ScaleTween(Transform t, Vector3 to, float time)
        {
            Vector3Tween tween = TweenPool.GetVector3Tween(t.localScale, to, time);

            tween.PauseReset += () => tween.Init(t.localScale, to, time);
            tween.SetOnUpdateVector3(delegate(Vector3 v)
            {
                if (t == null)
                {
                    CancelTween(tween);
                    return;
                }


                t.localScale = v;
            });
            return(ProcessTween(tween));
        }
コード例 #10
0
        public BaseTween Move(Transform obj, Transform to, float t)
        {
            MoveTween tween = TweenPool.GetMoveTween(obj, to, t);

            return(ProcessTween(tween));
        }
コード例 #11
0
        public BaseTween ValueTween(float from, float to, float t)
        {
            var tween = TweenPool.GetValueTween(from, to, t);

            return(ProcessTween(tween));
        }
コード例 #12
0
        public BaseTween VectorTween(Vector3 from, Vector3 to, float t)
        {
            Vector3Tween tween = TweenPool.GetVector3Tween(from, to, t);

            return(ProcessTween(tween));
        }
コード例 #13
0
        public BaseTween ColorTween(Color from, Color to, float t)
        {
            ColorTween tween = TweenPool.GetColorTween(from, to, t);

            return(ProcessTween(tween));
        }