static CustomIconHelper() { var fontName = "custom-icomoon"; if (m_Font == null) { m_Font = VectorImageManager.GetIconFont(fontName); } if (m_IconSet == null) { m_IconSet = VectorImageManager.GetIconSet(fontName); } }
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))); }
public static void OnPreRender() { bool colorSpaceChanged = CheckForColorSpaceChange(); bool importedTextureChanged = CheckForImportedTextures(); bool importedVectorImageChanged = CheckForImportedVectorImages(); if (colorSpaceChanged || importedTextureChanged) { UIRAtlasManager.MarkAllForReset(); VectorImageManager.MarkAllForReset(); } else if (colorSpaceChanged || importedVectorImageChanged) { VectorImageManager.MarkAllForReset(); } }
// If you want to get the icon from a icon font you downloaded: private ImageData GetIconFromIconFont(string fontName, string iconName) { VectorImageFont vectorFont = VectorImageManager.GetIconFont(fontName); if (vectorFont != null) { var glyph = vectorFont.GetGlyphByName(iconName); if (glyph == null) { Debug.LogError("Could not find an icon with the name: " + name + " inside the " + fontName + " icon font"); return(null); } return(new ImageData(new VectorImageData(glyph, vectorFont))); } return(null); }
public UIRStylePainter(RenderChain renderChain) { this.m_Owner = renderChain; this.< meshGenerationContext > k__BackingField = new MeshGenerationContext(this); this.< device > k__BackingField = renderChain.device; this.m_AtlasManager = renderChain.atlasManager; this.m_VectorImageManager = renderChain.vectorImageManager; this.m_AllocRawVertsIndicesDelegate = new MeshBuilder.AllocMeshData.Allocator(this.AllocRawVertsIndices); this.m_AllocThroughDrawMeshDelegate = new MeshBuilder.AllocMeshData.Allocator(this.AllocThroughDrawMesh); int num = 32; this.m_MeshWriteDataPool = new List <MeshWriteData>(num); for (int i = 0; i < num; i++) { this.m_MeshWriteDataPool.Add(new MeshWriteData()); } }
public UIRStylePainter(RenderChain renderChain) { m_Owner = renderChain; meshGenerationContext = new MeshGenerationContext(this); device = renderChain.device; m_Atlas = renderChain.atlas; m_VectorImageManager = renderChain.vectorImageManager; m_AllocRawVertsIndicesDelegate = AllocRawVertsIndices; m_AllocThroughDrawMeshDelegate = AllocThroughDrawMesh; m_AllocThroughDrawGradientsDelegate = AllocThroughDrawGradients; int meshWriteDataPoolStartingSize = 32; m_MeshWriteDataPool = new List <MeshWriteData>(meshWriteDataPoolStartingSize); for (int i = 0; i < meshWriteDataPoolStartingSize; i++) { m_MeshWriteDataPool.Add(new MeshWriteData()); } }
public static void OnPreRender() { bool flag = PackageEditorAtlasMonitor.CheckForColorSpaceChange(); bool flag2 = PackageEditorAtlasMonitor.CheckForImportedTextures(); bool flag3 = PackageEditorAtlasMonitor.CheckForImportedVectorImages(); bool flag4 = flag | flag2; if (flag4) { UIRAtlasManager.MarkAllForReset(); VectorImageManager.MarkAllForReset(); } else { bool flag5 = flag | flag3; if (flag5) { VectorImageManager.MarkAllForReset(); } } }