Exemplo n.º 1
0
    private void DoRun()
    {
        CancelInvoke();
        Graphic graphic  = GetComponent <Graphic>();
        Color   newColor = graphic.color;

        newColor.a = 0f;
        graphic.CrossFadeColor(newColor, _FlyTime * .7f, true, true);//*.7 means the color will change faster than position

        Graphic[] child_graphics = GetComponentsInChildren <Graphic>();
        for (int i = 0; i < child_graphics.Length; ++i)
        {
            child_graphics[i].CrossFadeColor(newColor, _FlyTime * .7f, true, true);
        }
        RectTrans.DOMoveY(transform.position.y + _FlyDistance, _FlyTime)
        .SetEase(_easeType)
        .OnComplete(TweenComplete);
    }