3 using System.Collections.Generic;
15 private List<TMP_Style> m_StyleList =
new List<TMP_Style>(1);
16 private Dictionary<int, TMP_Style> m_StyleDictionary =
new Dictionary<int, TMP_Style>();
26 if (s_Instance ==
null)
30 if (s_Instance ==
null)
31 s_Instance = Resources.Load<
TMP_StyleSheet>(
"Style Sheets/TMP Default Style Sheet");
33 if (s_Instance ==
null)
return null;
73 if (m_StyleDictionary.TryGetValue(hashCode, out style))
82 public void UpdateStyleDictionaryKey(
int old_key,
int new_key)
84 if (m_StyleDictionary.ContainsKey(old_key))
86 TMP_Style style = m_StyleDictionary[old_key];
87 m_StyleDictionary.Add(new_key, style);
88 m_StyleDictionary.Remove(old_key);
119 m_StyleDictionary.Clear();
122 for (
int i = 0; i < m_StyleList.Count; i++)
124 m_StyleList[i].RefreshStyle();
126 if (!m_StyleDictionary.ContainsKey(m_StyleList[i].hashCode))
127 m_StyleDictionary.Add(m_StyleList[i].hashCode, m_StyleList[i]);
static TMP_StyleSheet defaultStyleSheet
The Default Style Sheet used by the text objects.
TMP_Style GetStyleInternal(int hashCode)
Internal method to retrieve the Style matching the Hashcode.
static TMP_StyleSheet instance
Get a singleton instance of the TMP_StyleSheet
static void RefreshStyles()
Function to refresh the Style Dictionary.
static void UpdateStyleSheet()
Function to update the internal reference to a newly assigned style sheet in the TMP Settings.
void LoadStyleDictionaryInternal()
static TMP_StyleSheet LoadDefaultStyleSheet()
Static Function to load the Default Style Sheet.
static TMP_Style GetStyle(int hashCode)
Function to retrieve the Style matching the HashCode.