using System; using System.Collections.Generic; namespace UnityEngine.UI { // Token: 0x02000048 RID: 72 public static class FontUpdateTracker { // Token: 0x06000223 RID: 547 RVA: 0x0000AFB8 File Offset: 0x000093B8 public static void TrackText(Text t) { if (!(t.font == null)) { HashSet hashSet; FontUpdateTracker.m_Tracked.TryGetValue(t.font, out hashSet); if (hashSet == null) { if (FontUpdateTracker.m_Tracked.Count == 0) { Font.textureRebuilt += FontUpdateTracker.RebuildForFont; } hashSet = new HashSet(); FontUpdateTracker.m_Tracked.Add(t.font, hashSet); } if (!hashSet.Contains(t)) { hashSet.Add(t); } } } // Token: 0x06000224 RID: 548 RVA: 0x0000B054 File Offset: 0x00009454 private static void RebuildForFont(Font f) { HashSet hashSet; FontUpdateTracker.m_Tracked.TryGetValue(f, out hashSet); if (hashSet != null) { foreach (Text text in hashSet) { text.FontTextureChanged(); } } } // Token: 0x06000225 RID: 549 RVA: 0x0000B0C8 File Offset: 0x000094C8 public static void UntrackText(Text t) { if (!(t.font == null)) { HashSet hashSet; FontUpdateTracker.m_Tracked.TryGetValue(t.font, out hashSet); if (hashSet != null) { hashSet.Remove(t); if (hashSet.Count == 0) { FontUpdateTracker.m_Tracked.Remove(t.font); if (FontUpdateTracker.m_Tracked.Count == 0) { Font.textureRebuilt -= FontUpdateTracker.RebuildForFont; } } } } } // Token: 0x04000104 RID: 260 private static Dictionary> m_Tracked = new Dictionary>(); } }