コード例 #1
0
    private IEnumerator CollectMaterial()
    {
        yield return(null);

        yield return(null);

        UIPanel         panel   = GetComponent <UIPanel>();
        List <UIWidget> widgets = panel.widgets;

        foreach (var w in widgets)
        {
            if (!(w is UISprite))
            {
                continue;
            }
            UISprite sp = w as UISprite;

            UIAtlas atlas = sp.atlas;
            string  name  = atlas.name;

            MaterialTick mt = null;
            if (m_TextureSet.TryGetValue(name, out mt))
            {
                if (mt.tick <= 0)
                {
                    mt.atlas = atlas;
                }
            }
            else
            {
                m_TextureSet.Add(name, new MaterialTick(atlas));
            }
        }
    }
コード例 #2
0
    private IEnumerator Load()
    {
        foreach (var m in m_TextureSet)
        {
            MaterialTick mt = m.Value;
            var          rq = mt.BeginRemain();
            if (rq == null)
            {
                continue;
            }

            while (!rq.isDone)
            {
                yield return(null);
            }
            mt.EndRemain(rq);
        }
        //gameObject.SetActive(false);
        //gameObject.SetActive(true);
    }