public void AppendTexture(VisualElement ve, Texture src, TextureId id, bool isAtlas)
        {
            BasicNode <TextureEntry> node = m_TexturePool.Get();

            node.data.source   = src;
            node.data.actual   = id;
            node.data.replaced = isAtlas;
            node.AppendTo(ref ve.renderChainData.textures);
        }
        public void AppendTo(ref BasicNode <T> first)
        {
            if (first == null)
            {
                first = this;
                return;
            }

            var current = first;

            while (current.next != null)
            {
                current = current.next;
            }

            current.next = this;
        }
        public void ResetTextures(VisualElement ve)
        {
            AtlasBase       atlas             = this.atlas;
            TextureRegistry registry          = m_TextureRegistry;
            BasicNodePool <TextureEntry> pool = m_TexturePool;

            BasicNode <TextureEntry> current = ve.renderChainData.textures;

            ve.renderChainData.textures = null;
            while (current != null)
            {
                var next = current.next;
                if (current.data.replaced)
                {
                    atlas.ReturnAtlas(ve, current.data.source as Texture2D, current.data.actual);
                }
                else
                {
                    registry.Release(current.data.actual);
                }
                pool.Return(current);
                current = next;
            }
        }
 static void Reset(BasicNode <T> node)
 {
     node.next = null;
     node.data = default(T);
 }