コード例 #1
0
    static CustomIconHelper()
    {
        var fontName = "custom-icomoon";

        if (m_Font == null)
        {
            m_Font = VectorImageManager.GetIconFont(fontName);
        }

        if (m_IconSet == null)
        {
            m_IconSet = VectorImageManager.GetIconSet(fontName);
        }
    }
コード例 #2
0
        static ImageData GetIconFromIconFont(string fontName, string iconName)
        {
            VectorImageSet iconSet = VectorImageManager.GetIconSet(fontName);
            Glyph          glyph   = iconSet.iconGlyphList.FirstOrDefault(x => x.name.ToLower().Equals(iconName.ToLower()));

            if (glyph == null)
            {
                Debug.LogError("Could not find an icon with the name: " + iconName + " inside the " + fontName + " icon font");
                return(null);
            }

            Font font = VectorImageManager.GetIconFont(fontName);

            return(new ImageData(new VectorImageData(glyph, font)));
        }