public void Dispose()
        {
            if (allatlas != null)
            {
                ListPool <SpriteAsset> .Release(allatlas);

                allatlas = null;
            }

            if (alltexts != null)
            {
                ListPool <InlineText> .Release(alltexts);

                alltexts = null;
            }

            if (tempMesh != null)
            {
                UnitMeshInfoPool.Release(tempMesh);
                tempMesh = null;
            }

            if (GraphicTasks != null)
            {
                for (int i = 0; i < GraphicTasks.Count; ++i)
                {
                    CanvasGraphicGroup group  = GraphicTasks[i];
                    SpriteGraphic      target = group.graphic;
                    if (target != null)
                    {
                        target.Draw(null);
                        target.SetDirtyMask();
                        target.SetVerticesDirty();
                    }

                    if (group.mesh != null)
                    {
                        UnitMeshInfoPool.Release(group.mesh);
                    }
                }

                GraphicTasks.Clear();
                GraphicTasks = null;
            }

            if (rebuildqueue != null)
            {
                ListPool <InlineText> .Release(rebuildqueue);

                rebuildqueue = null;
            }


            if (listeners != null)
            {
                listeners.Clear();
                listeners = null;
            }

            if (tempMesh != null)
            {
                UnitMeshInfoPool.Release(tempMesh);
                tempMesh = null;
            }

            _time = null;
        }
        public void Dispose()
        {
            if (allatlas != null)
            {
                ListPool <SpriteAsset> .Release(allatlas);

                allatlas = null;
            }

            if (alltexts != null)
            {
                ListPool <InlineText> .Release(alltexts);

                alltexts = null;
            }

            if (tempMesh != null)
            {
                UnitMeshInfoPool.Release(tempMesh);
                tempMesh = null;
            }

            if (textGraphics != null)
            {
                var en = textGraphics.GetEnumerator();
                while (en.MoveNext())
                {
                    var list = en.Current.Value;
                    for (int i = 0; i < list.Count; ++i)
                    {
                        var target = list[i];
                        if (target != null)
                        {
                            target.Draw(null);
                            target.SetDirtyMask();
                            target.SetVerticesDirty();
                        }
                    }

                    ListPool <SpriteGraphic> .Release(en.Current.Value);
                }
                textGraphics = null;
            }

            if (rebuildqueue != null)
            {
                ListPool <InlineText> .Release(rebuildqueue);

                rebuildqueue = null;
            }

            if (renderData != null)
            {
                renderData.Clear();
                renderData = null;
            }

            if (tempMesh != null)
            {
                UnitMeshInfoPool.Release(tempMesh);
                tempMesh = null;
            }

            _time = null;
        }