Unity UGUI 一个UI逐渐显示或者逐渐消失


```csharp
protected void GraduallyShow(GameObject go,float time = 0.5f)
        {
            Transform[] transforms =  go.GetComponentsInChildren<Transform>();
            foreach (var transformChild in transforms)
            {
                Image image = transformChild.gameObject.GetComponent<Image>();
                if (image)
                {
                    image.color = new Color(1,1,1,0.3f);
                    image.DOFade(1,time);
                }
                Text text = transformChild.gameObject.GetComponent<Text>();
                if (text)
                {
                    text.color = new Color(text.color.r ,text.color.g ,text.color.b,0.3f);
                    text.DOFade(1,time);
                }
            }
        }

上一篇:UGUI的简单理解


下一篇:UGUI的优化技巧