/// <summary> /// /// </summary> public void ReadFontDefinition() { //Debug.Log("Reading Font Definition for " + this.name + "."); // Make sure that we have a Font Asset file assigned. if (m_fontInfo == null) { return; } // Check Font Asset type //Debug.Log(name + " " + fontAssetType); // Create new instance of GlyphInfo Dictionary for fast access to glyph info. m_characterDictionary = new Dictionary <int, TMP_Glyph>(); for (int i = 0; i < m_glyphInfoList.Count; i++) { TMP_Glyph glyph = m_glyphInfoList[i]; if (!m_characterDictionary.ContainsKey(glyph.id)) { m_characterDictionary.Add(glyph.id, glyph); } // Compatibility if (glyph.scale == 0) { glyph.scale = 1; } } //Debug.Log("PRE: BaseLine:" + m_fontInfo.Baseline + " Ascender:" + m_fontInfo.Ascender + " Descender:" + m_fontInfo.Descender); // + " Centerline:" + m_fontInfo.CenterLine); TMP_Glyph temp_charInfo = new TMP_Glyph(); // Add Character (10) LineFeed, (13) Carriage Return & Space (32) to Dictionary if they don't exists. if (m_characterDictionary.ContainsKey(32)) { m_characterDictionary[32].width = m_characterDictionary[32].xAdvance; // m_fontInfo.Ascender / 5; m_characterDictionary[32].height = m_fontInfo.Ascender - m_fontInfo.Descender; m_characterDictionary[32].yOffset = m_fontInfo.Ascender; m_characterDictionary[32].scale = 1; } else { //Debug.Log("Adding Character 32 (Space) to Dictionary for Font (" + m_fontInfo.Name + ")."); temp_charInfo = new TMP_Glyph(); temp_charInfo.id = 32; temp_charInfo.x = 0; temp_charInfo.y = 0; temp_charInfo.width = m_fontInfo.Ascender / 5; temp_charInfo.height = m_fontInfo.Ascender - m_fontInfo.Descender; temp_charInfo.xOffset = 0; temp_charInfo.yOffset = m_fontInfo.Ascender; temp_charInfo.xAdvance = m_fontInfo.PointSize / 4; temp_charInfo.scale = 1; m_characterDictionary.Add(32, temp_charInfo); } // Add Non-Breaking Space (160) if (!m_characterDictionary.ContainsKey(160)) { temp_charInfo = TMP_Glyph.Clone(m_characterDictionary[32]); m_characterDictionary.Add(160, temp_charInfo); } // Add Zero Width Space (8203) if (!m_characterDictionary.ContainsKey(8203)) { temp_charInfo = TMP_Glyph.Clone(m_characterDictionary[32]); temp_charInfo.width = 0; temp_charInfo.xAdvance = 0; m_characterDictionary.Add(8203, temp_charInfo); } //Add Zero Width no-break space (8288) if (!m_characterDictionary.ContainsKey(8288)) { temp_charInfo = TMP_Glyph.Clone(m_characterDictionary[32]); temp_charInfo.width = 0; temp_charInfo.xAdvance = 0; m_characterDictionary.Add(8288, temp_charInfo); } // Add Linefeed (10) if (m_characterDictionary.ContainsKey(10) == false) { //Debug.Log("Adding Character 10 (Linefeed) to Dictionary for Font (" + m_fontInfo.Name + ")."); temp_charInfo = new TMP_Glyph(); temp_charInfo.id = 10; temp_charInfo.x = 0; // m_characterDictionary[32].x; temp_charInfo.y = 0; // m_characterDictionary[32].y; temp_charInfo.width = 10; // m_characterDictionary[32].width; temp_charInfo.height = m_characterDictionary[32].height; temp_charInfo.xOffset = 0; // m_characterDictionary[32].xOffset; temp_charInfo.yOffset = m_characterDictionary[32].yOffset; temp_charInfo.xAdvance = 0; temp_charInfo.scale = 1; m_characterDictionary.Add(10, temp_charInfo); if (!m_characterDictionary.ContainsKey(13)) { m_characterDictionary.Add(13, temp_charInfo); } } // Add Tab Character to Dictionary. Tab is Tab Size * Space Character Width. if (m_characterDictionary.ContainsKey(9) == false) { //Debug.Log("Adding Character 9 (Tab) to Dictionary for Font (" + m_fontInfo.Name + ")."); temp_charInfo = new TMP_Glyph(); temp_charInfo.id = 9; temp_charInfo.x = m_characterDictionary[32].x; temp_charInfo.y = m_characterDictionary[32].y; temp_charInfo.width = m_characterDictionary[32].width * tabSize + (m_characterDictionary[32].xAdvance - m_characterDictionary[32].width) * (tabSize - 1); temp_charInfo.height = m_characterDictionary[32].height; temp_charInfo.xOffset = m_characterDictionary[32].xOffset; temp_charInfo.yOffset = m_characterDictionary[32].yOffset; temp_charInfo.xAdvance = m_characterDictionary[32].xAdvance * tabSize; temp_charInfo.scale = 1; m_characterDictionary.Add(9, temp_charInfo); } // Centerline is located at the center of character like { or in the middle of the lowercase o. //m_fontInfo.CenterLine = m_characterDictionary[111].yOffset - m_characterDictionary[111].height * 0.5f; // Tab Width is using the same xAdvance as space (32). m_fontInfo.TabWidth = m_characterDictionary[9].xAdvance; // Set Cap Height if (m_fontInfo.CapHeight == 0 && m_characterDictionary.ContainsKey(72)) { m_fontInfo.CapHeight = m_characterDictionary[72].yOffset; } // Adjust Font Scale for compatibility reasons if (m_fontInfo.Scale == 0) { m_fontInfo.Scale = 1.0f; } // Set Strikethrough Offset (if needed) if (m_fontInfo.strikethrough == 0) { m_fontInfo.strikethrough = m_fontInfo.CapHeight / 2.5f; } // Set Padding value for legacy font assets. if (m_fontInfo.Padding == 0) { if (material.HasProperty(ShaderUtilities.ID_GradientScale)) { m_fontInfo.Padding = material.GetFloat(ShaderUtilities.ID_GradientScale) - 1; } } // Populate Dictionary with Kerning Information m_kerningDictionary = new Dictionary <int, KerningPair>(); List <KerningPair> pairs = m_kerningInfo.kerningPairs; //Debug.Log(m_fontInfo.Name + " has " + pairs.Count + " Kerning Pairs."); for (int i = 0; i < pairs.Count; i++) { KerningPair pair = pairs[i]; // Convert legacy kerning data if (pair.xOffset != 0) { pairs[i].ConvertLegacyKerningData(); } KerningPairKey uniqueKey = new KerningPairKey(pair.firstGlyph, pair.secondGlyph); if (m_kerningDictionary.ContainsKey((int)uniqueKey.key) == false) { m_kerningDictionary.Add((int)uniqueKey.key, pair); } else { if (!TMP_Settings.warningsDisabled) { Debug.LogWarning("Kerning Key for [" + uniqueKey.ascii_Left + "] and [" + uniqueKey.ascii_Right + "] already exists."); } } } // Compute Hashcode for the font asset name hashCode = TMP_TextUtilities.GetSimpleHashCode(this.name); // Compute Hashcode for the material name materialHashCode = TMP_TextUtilities.GetSimpleHashCode(material.name); // Unload font atlas texture //ShaderUtilities.GetShaderPropertyIDs(); //Resources.UnloadAsset(material.GetTexture(ShaderUtilities.ID_MainTex)); // Initialize Font Weights if needed //InitializeFontWeights(); }
public void ReadFontDefinition() { if (m_fontInfo == null) { return; } m_characterDictionary = new Dictionary <int, TMP_Glyph>(); for (int i = 0; i < m_glyphInfoList.Count; i++) { TMP_Glyph tMP_Glyph = m_glyphInfoList[i]; if (!m_characterDictionary.ContainsKey(tMP_Glyph.id)) { m_characterDictionary.Add(tMP_Glyph.id, tMP_Glyph); } if (tMP_Glyph.scale == 0f) { tMP_Glyph.scale = 1f; } } TMP_Glyph tMP_Glyph2 = new TMP_Glyph(); if (m_characterDictionary.ContainsKey(32)) { m_characterDictionary[32].width = m_characterDictionary[32].xAdvance; m_characterDictionary[32].height = m_fontInfo.Ascender - m_fontInfo.Descender; m_characterDictionary[32].yOffset = m_fontInfo.Ascender; m_characterDictionary[32].scale = 1f; } else { tMP_Glyph2 = new TMP_Glyph(); tMP_Glyph2.id = 32; tMP_Glyph2.x = 0f; tMP_Glyph2.y = 0f; tMP_Glyph2.width = m_fontInfo.Ascender / 5f; tMP_Glyph2.height = m_fontInfo.Ascender - m_fontInfo.Descender; tMP_Glyph2.xOffset = 0f; tMP_Glyph2.yOffset = m_fontInfo.Ascender; tMP_Glyph2.xAdvance = m_fontInfo.PointSize / 4f; tMP_Glyph2.scale = 1f; m_characterDictionary.Add(32, tMP_Glyph2); } if (!m_characterDictionary.ContainsKey(160)) { tMP_Glyph2 = TMP_Glyph.Clone(m_characterDictionary[32]); m_characterDictionary.Add(160, tMP_Glyph2); } if (!m_characterDictionary.ContainsKey(8203)) { tMP_Glyph2 = TMP_Glyph.Clone(m_characterDictionary[32]); tMP_Glyph2.width = 0f; tMP_Glyph2.xAdvance = 0f; m_characterDictionary.Add(8203, tMP_Glyph2); } if (!m_characterDictionary.ContainsKey(8288)) { tMP_Glyph2 = TMP_Glyph.Clone(m_characterDictionary[32]); tMP_Glyph2.width = 0f; tMP_Glyph2.xAdvance = 0f; m_characterDictionary.Add(8288, tMP_Glyph2); } if (!m_characterDictionary.ContainsKey(10)) { tMP_Glyph2 = new TMP_Glyph(); tMP_Glyph2.id = 10; tMP_Glyph2.x = 0f; tMP_Glyph2.y = 0f; tMP_Glyph2.width = 10f; tMP_Glyph2.height = m_characterDictionary[32].height; tMP_Glyph2.xOffset = 0f; tMP_Glyph2.yOffset = m_characterDictionary[32].yOffset; tMP_Glyph2.xAdvance = 0f; tMP_Glyph2.scale = 1f; m_characterDictionary.Add(10, tMP_Glyph2); if (!m_characterDictionary.ContainsKey(13)) { m_characterDictionary.Add(13, tMP_Glyph2); } } if (!m_characterDictionary.ContainsKey(9)) { tMP_Glyph2 = new TMP_Glyph(); tMP_Glyph2.id = 9; tMP_Glyph2.x = m_characterDictionary[32].x; tMP_Glyph2.y = m_characterDictionary[32].y; tMP_Glyph2.width = m_characterDictionary[32].width * (float)(int)tabSize + (m_characterDictionary[32].xAdvance - m_characterDictionary[32].width) * (float)(tabSize - 1); tMP_Glyph2.height = m_characterDictionary[32].height; tMP_Glyph2.xOffset = m_characterDictionary[32].xOffset; tMP_Glyph2.yOffset = m_characterDictionary[32].yOffset; tMP_Glyph2.xAdvance = m_characterDictionary[32].xAdvance * (float)(int)tabSize; tMP_Glyph2.scale = 1f; m_characterDictionary.Add(9, tMP_Glyph2); } m_fontInfo.TabWidth = m_characterDictionary[9].xAdvance; if (m_fontInfo.CapHeight == 0f && m_characterDictionary.ContainsKey(72)) { m_fontInfo.CapHeight = m_characterDictionary[72].yOffset; } if (m_fontInfo.Scale == 0f) { m_fontInfo.Scale = 1f; } if (m_fontInfo.strikethrough == 0f) { m_fontInfo.strikethrough = m_fontInfo.CapHeight / 2.5f; } if (m_fontInfo.Padding == 0f && material.HasProperty(ShaderUtilities.ID_GradientScale)) { m_fontInfo.Padding = material.GetFloat(ShaderUtilities.ID_GradientScale) - 1f; } m_kerningDictionary = new Dictionary <int, KerningPair>(); List <KerningPair> kerningPairs = m_kerningInfo.kerningPairs; for (int j = 0; j < kerningPairs.Count; j++) { KerningPair kerningPair = kerningPairs[j]; KerningPairKey kerningPairKey = new KerningPairKey(kerningPair.AscII_Left, kerningPair.AscII_Right); if (!m_kerningDictionary.ContainsKey(kerningPairKey.key)) { m_kerningDictionary.Add(kerningPairKey.key, kerningPair); } else if (!TMP_Settings.warningsDisabled) { Debug.LogWarning("Kerning Key for [" + kerningPairKey.ascii_Left + "] and [" + kerningPairKey.ascii_Right + "] already exists."); } } hashCode = TMP_TextUtilities.GetSimpleHashCode(base.name); materialHashCode = TMP_TextUtilities.GetSimpleHashCode(material.name); }
public void ReadFontDefinition() { if (this.m_fontInfo == null) { return; } this.m_characterDictionary = new Dictionary <int, TMP_Glyph>(); for (int i = 0; i < this.m_glyphInfoList.Count; i++) { TMP_Glyph tmp_Glyph = this.m_glyphInfoList[i]; if (!this.m_characterDictionary.ContainsKey(tmp_Glyph.id)) { this.m_characterDictionary.Add(tmp_Glyph.id, tmp_Glyph); } if (tmp_Glyph.scale == 0f) { tmp_Glyph.scale = 1f; } } TMP_Glyph tmp_Glyph2 = new TMP_Glyph(); if (this.m_characterDictionary.ContainsKey(32)) { this.m_characterDictionary[32].width = this.m_characterDictionary[32].xAdvance; this.m_characterDictionary[32].height = this.m_fontInfo.Ascender - this.m_fontInfo.Descender; this.m_characterDictionary[32].yOffset = this.m_fontInfo.Ascender; this.m_characterDictionary[32].scale = 1f; } else { tmp_Glyph2 = new TMP_Glyph(); tmp_Glyph2.id = 32; tmp_Glyph2.x = 0f; tmp_Glyph2.y = 0f; tmp_Glyph2.width = this.m_fontInfo.Ascender / 5f; tmp_Glyph2.height = this.m_fontInfo.Ascender - this.m_fontInfo.Descender; tmp_Glyph2.xOffset = 0f; tmp_Glyph2.yOffset = this.m_fontInfo.Ascender; tmp_Glyph2.xAdvance = this.m_fontInfo.PointSize / 4f; tmp_Glyph2.scale = 1f; this.m_characterDictionary.Add(32, tmp_Glyph2); } if (!this.m_characterDictionary.ContainsKey(160)) { tmp_Glyph2 = TMP_Glyph.Clone(this.m_characterDictionary[32]); this.m_characterDictionary.Add(160, tmp_Glyph2); } if (!this.m_characterDictionary.ContainsKey(8203)) { tmp_Glyph2 = TMP_Glyph.Clone(this.m_characterDictionary[32]); tmp_Glyph2.width = 0f; tmp_Glyph2.xAdvance = 0f; this.m_characterDictionary.Add(8203, tmp_Glyph2); } if (!this.m_characterDictionary.ContainsKey(8288)) { tmp_Glyph2 = TMP_Glyph.Clone(this.m_characterDictionary[32]); tmp_Glyph2.width = 0f; tmp_Glyph2.xAdvance = 0f; this.m_characterDictionary.Add(8288, tmp_Glyph2); } if (!this.m_characterDictionary.ContainsKey(10)) { tmp_Glyph2 = new TMP_Glyph(); tmp_Glyph2.id = 10; tmp_Glyph2.x = 0f; tmp_Glyph2.y = 0f; tmp_Glyph2.width = 10f; tmp_Glyph2.height = this.m_characterDictionary[32].height; tmp_Glyph2.xOffset = 0f; tmp_Glyph2.yOffset = this.m_characterDictionary[32].yOffset; tmp_Glyph2.xAdvance = 0f; tmp_Glyph2.scale = 1f; this.m_characterDictionary.Add(10, tmp_Glyph2); if (!this.m_characterDictionary.ContainsKey(13)) { this.m_characterDictionary.Add(13, tmp_Glyph2); } } if (!this.m_characterDictionary.ContainsKey(9)) { tmp_Glyph2 = new TMP_Glyph(); tmp_Glyph2.id = 9; tmp_Glyph2.x = this.m_characterDictionary[32].x; tmp_Glyph2.y = this.m_characterDictionary[32].y; tmp_Glyph2.width = this.m_characterDictionary[32].width * (float)this.tabSize + (this.m_characterDictionary[32].xAdvance - this.m_characterDictionary[32].width) * (float)(this.tabSize - 1); tmp_Glyph2.height = this.m_characterDictionary[32].height; tmp_Glyph2.xOffset = this.m_characterDictionary[32].xOffset; tmp_Glyph2.yOffset = this.m_characterDictionary[32].yOffset; tmp_Glyph2.xAdvance = this.m_characterDictionary[32].xAdvance * (float)this.tabSize; tmp_Glyph2.scale = 1f; this.m_characterDictionary.Add(9, tmp_Glyph2); } this.m_fontInfo.TabWidth = this.m_characterDictionary[9].xAdvance; if (this.m_fontInfo.CapHeight == 0f && this.m_characterDictionary.ContainsKey(72)) { this.m_fontInfo.CapHeight = this.m_characterDictionary[72].yOffset; } if (this.m_fontInfo.Scale == 0f) { this.m_fontInfo.Scale = 1f; } if (this.m_fontInfo.strikethrough == 0f) { this.m_fontInfo.strikethrough = this.m_fontInfo.CapHeight / 2.5f; } if (this.m_fontInfo.Padding == 0f && this.material.HasProperty(ShaderUtilities.ID_GradientScale)) { this.m_fontInfo.Padding = this.material.GetFloat(ShaderUtilities.ID_GradientScale) - 1f; } this.m_kerningDictionary = new Dictionary <int, KerningPair>(); List <KerningPair> kerningPairs = this.m_kerningInfo.kerningPairs; for (int j = 0; j < kerningPairs.Count; j++) { KerningPair kerningPair = kerningPairs[j]; if (kerningPair.xOffset != 0f) { kerningPairs[j].ConvertLegacyKerningData(); } KerningPairKey kerningPairKey = new KerningPairKey(kerningPair.firstGlyph, kerningPair.secondGlyph); if (!this.m_kerningDictionary.ContainsKey((int)kerningPairKey.key)) { this.m_kerningDictionary.Add((int)kerningPairKey.key, kerningPair); } else if (!TMP_Settings.warningsDisabled) { Debug.LogWarning(string.Concat(new object[] { "Kerning Key for [", kerningPairKey.ascii_Left, "] and [", kerningPairKey.ascii_Right, "] already exists." })); } } this.hashCode = TMP_TextUtilities.GetSimpleHashCode(base.name); this.materialHashCode = TMP_TextUtilities.GetSimpleHashCode(this.material.name); }
public void ReadFontDefinition() { //Debug.Log("Reading Font Definition for " + this.name + "."); // Make sure that we have a Font Asset file assigned. if (m_fontInfo == null) { return; } // Check Font Asset type //Debug.Log(name + " " + fontAssetType); // Create new instance of GlyphInfo Dictionary for fast access to glyph info. m_characterDictionary = new Dictionary <int, TMP_Glyph>(); foreach (TMP_Glyph glyph in m_glyphInfoList) { if (!m_characterDictionary.ContainsKey(glyph.id)) { m_characterDictionary.Add(glyph.id, glyph); } } //Debug.Log("PRE: BaseLine:" + m_fontInfo.Baseline + " Ascender:" + m_fontInfo.Ascender + " Descender:" + m_fontInfo.Descender); // + " Centerline:" + m_fontInfo.CenterLine); TMP_Glyph temp_charInfo = new TMP_Glyph(); // Add Character (10) LineFeed, (13) Carriage Return & Space (32) to Dictionary if they don't exists. if (m_characterDictionary.ContainsKey(32)) { m_characterDictionary[32].width = m_characterDictionary[32].xAdvance; // m_fontInfo.Ascender / 5; m_characterDictionary[32].height = m_fontInfo.Ascender - m_fontInfo.Descender; m_characterDictionary[32].yOffset = m_fontInfo.Ascender; } else { //Debug.Log("Adding Character 32 (Space) to Dictionary for Font (" + m_fontInfo.Name + ")."); temp_charInfo = new TMP_Glyph(); temp_charInfo.id = 32; temp_charInfo.x = 0; temp_charInfo.y = 0; temp_charInfo.width = m_fontInfo.Ascender / 5; temp_charInfo.height = m_fontInfo.Ascender - m_fontInfo.Descender; temp_charInfo.xOffset = 0; temp_charInfo.yOffset = m_fontInfo.Ascender; temp_charInfo.xAdvance = m_fontInfo.PointSize / 4; m_characterDictionary.Add(32, temp_charInfo); } // Add Non-Breaking Space (160) if (!m_characterDictionary.ContainsKey(160)) { temp_charInfo = TMP_Glyph.Clone(m_characterDictionary[32]); m_characterDictionary.Add(160, temp_charInfo); } if (m_characterDictionary.ContainsKey(10) == false) { //Debug.Log("Adding Character 10 (Linefeed) to Dictionary for Font (" + m_fontInfo.Name + ")."); temp_charInfo = new TMP_Glyph(); temp_charInfo.id = 10; temp_charInfo.x = 0; // m_characterDictionary[32].x; temp_charInfo.y = 0; // m_characterDictionary[32].y; temp_charInfo.width = 10; // m_characterDictionary[32].width; temp_charInfo.height = m_characterDictionary[32].height; temp_charInfo.xOffset = 0; // m_characterDictionary[32].xOffset; temp_charInfo.yOffset = m_characterDictionary[32].yOffset; temp_charInfo.xAdvance = 0; m_characterDictionary.Add(10, temp_charInfo); if (!m_characterDictionary.ContainsKey(13)) { m_characterDictionary.Add(13, temp_charInfo); } } // Add Tab Character to Dictionary. Tab is Tab Size * Space Character Width. if (m_characterDictionary.ContainsKey(9) == false) { //Debug.Log("Adding Character 9 (Tab) to Dictionary for Font (" + m_fontInfo.Name + ")."); temp_charInfo = new TMP_Glyph(); temp_charInfo.id = 9; temp_charInfo.x = m_characterDictionary[32].x; temp_charInfo.y = m_characterDictionary[32].y; temp_charInfo.width = m_characterDictionary[32].width * tabSize + (m_characterDictionary[32].xAdvance - m_characterDictionary[32].width) * (tabSize - 1); temp_charInfo.height = m_characterDictionary[32].height; temp_charInfo.xOffset = m_characterDictionary[32].xOffset; temp_charInfo.yOffset = m_characterDictionary[32].yOffset; temp_charInfo.xAdvance = m_characterDictionary[32].xAdvance * tabSize; m_characterDictionary.Add(9, temp_charInfo); } // Centerline is located at the center of character like { or in the middle of the lowercase o. //m_fontInfo.CenterLine = m_characterDictionary[111].yOffset - m_characterDictionary[111].height * 0.5f; // Tab Width is using the same xAdvance as space (32). m_fontInfo.TabWidth = m_characterDictionary[9].xAdvance; // Adjust Font Scale for compatibility reasons if (m_fontInfo.Scale == 0) { m_fontInfo.Scale = 1.0f; } // Populate Dictionary with Kerning Information m_kerningDictionary = new Dictionary <int, KerningPair>(); List <KerningPair> pairs = m_kerningInfo.kerningPairs; //Debug.Log(m_fontInfo.Name + " has " + pairs.Count + " Kerning Pairs."); for (int i = 0; i < pairs.Count; i++) { KerningPair pair = pairs[i]; KerningPairKey uniqueKey = new KerningPairKey(pair.AscII_Left, pair.AscII_Right); if (m_kerningDictionary.ContainsKey(uniqueKey.key) == false) { m_kerningDictionary.Add(uniqueKey.key, pair); } else { Debug.Log("Kerning Key for [" + uniqueKey.ascii_Left + "] and [" + uniqueKey.ascii_Right + "] already exists."); } } // Add Line Breaking Characters m_lineBreakingInfo = new LineBreakingTable(); TextAsset leadingCharFile = Resources.Load("LineBreaking Leading Characters", typeof(TextAsset)) as TextAsset; if (leadingCharFile != null) { m_lineBreakingInfo.leadingCharacters = GetCharacters(leadingCharFile); } TextAsset followingCharFile = Resources.Load("LineBreaking Following Characters", typeof(TextAsset)) as TextAsset; if (followingCharFile != null) { m_lineBreakingInfo.followingCharacters = GetCharacters(followingCharFile); } // Compute Hashcode for the font asset name fontHashCode = TMP_TextUtilities.GetSimpleHashCode(this.name); // Compute Hashcode for the material name materialHashCode = TMP_TextUtilities.GetSimpleHashCode(material.name); }