Exemplo n.º 1
0
        void Update()
        {
            if (cTween == null)
            {
                return;
            }
            Vector3 vector = trans.localScale;

            if (xAxis.canGo)
            {
                vector.x = (float)cTween.Ease(t, xAxis.b, xAxis.c, d);
            }
            if (yAxis.canGo)
            {
                vector.y = (float)cTween.Ease(t, yAxis.b, yAxis.c, d);
            }
            if (zAxis.canGo)
            {
                vector.z = (float)cTween.Ease(t, zAxis.b, zAxis.c, d);
            }
            trans.localScale = vector;
            if (t < d)
            {
                t += Time.deltaTime;
            }
            else
            {
                trans.localScale = toScale;
                this.enabled     = false;
                if (EndEvent != null)
                {
                    EndEvent();
                }
            }
        }
Exemplo n.º 2
0
        void Update()
        {
            if (cTween == null)
            {
                return;
            }
            float alpha = (float)cTween.Ease(t, b, c, d);

            SetSpriteRendererAlpha(alpha);
            SetImageAlpha(alpha);
            SetRawImageAlpha(alpha);
            SetTextAlpha(alpha);
            if (t < d)
            {
                t += Time.deltaTime;
            }
            else
            {
                SetSpriteRendererAlpha(toAlpha);
                SetImageAlpha(toAlpha);
                SetRawImageAlpha(toAlpha);
                SetTextAlpha(toAlpha);
                this.enabled = false;
                if (EndEvent != null)
                {
                    EndEvent();
                }
                if (destroySelfWhenFinish)
                {
                    Destroy(gameObject);
                }
            }
        }
Exemplo n.º 3
0
        void Update()
        {
            if (cTween == null)
            {
                return;
            }
            Vector3 vector = trans.anchoredPosition;

            if (xAxis.canGo)
            {
                vector.x = (float)cTween.Ease(t, xAxis.b, xAxis.c, d);
            }
            if (yAxis.canGo)
            {
                vector.y = (float)cTween.Ease(t, yAxis.b, yAxis.c, d);
            }
            trans.anchoredPosition = vector;
            if (t < d)
            {
                t += Time.deltaTime;
            }
            else
            {
                if (!xAxis.canGo)
                {
                    toPos.x = trans.anchoredPosition.x;
                }
                if (!yAxis.canGo)
                {
                    toPos.y = trans.anchoredPosition.y;
                }
                trans.anchoredPosition = toPos;
                this.enabled           = false;
                if (EndEvent != null)
                {
                    EndEvent();
                }
            }
        }
Exemplo n.º 4
0
        void Update()
        {
            if (cTween == null)
            {
                return;
            }
            Vector3 vector = useWorldPos?trans.position:trans.localPosition;

            if (xAxis.canGo)
            {
                vector.x = (float)cTween.Ease(t, xAxis.b, xAxis.c, d);
            }
            if (yAxis.canGo)
            {
                vector.y = (float)cTween.Ease(t, yAxis.b, yAxis.c, d);
            }
            if (zAxis.canGo)
            {
                vector.z = (float)cTween.Ease(t, zAxis.b, zAxis.c, d);
            }
            if (useWorldPos)
            {
                trans.position = vector;
            }
            else
            {
                trans.localPosition = vector;
            }
            if (t < d)
            {
                t += Time.deltaTime;
            }
            else
            {
                if (useWorldPos)
                {
                    if (!xAxis.canGo)
                    {
                        toPos.x = trans.position.x;
                    }
                    if (!yAxis.canGo)
                    {
                        toPos.y = trans.position.y;
                    }
                    if (!zAxis.canGo)
                    {
                        toPos.z = trans.position.z;
                    }
                    trans.position = toPos;
                }
                else
                {
                    if (!xAxis.canGo)
                    {
                        toPos.x = trans.localPosition.x;
                    }
                    if (!yAxis.canGo)
                    {
                        toPos.y = trans.localPosition.y;
                    }
                    if (!zAxis.canGo)
                    {
                        toPos.z = trans.localPosition.z;
                    }
                    trans.localPosition = toPos;
                }
                this.enabled = false;
                if (EndEvent != null)
                {
                    EndEvent();
                }
            }
        }