public Texture2D GetReadableTexture2D() { if (m_ReadableTexture == null) { if (GetImporter().SvgType == SVGType.VectorSprite) { var sprite = GetSprite(); var size = ((Vector2)sprite.bounds.size) * sprite.pixelsPerUnit; m_ReadableTexture = VectorUtils.RenderSpriteToTexture2D(sprite, (int)size.x, (int)size.y, SVGImporter.GetSVGSpriteMaterial(sprite), 4); } else { return(GetTexture2D()); } } return(m_ReadableTexture); }
internal static Texture2D BuildPreviewTexture(Sprite sprite, int width, int height) { return(VectorUtils.RenderSpriteToTexture2D(sprite, width, height, SVGImporter.GetSVGSpriteMaterial(sprite), 4)); }