using System.Collections; using System.Collections.Generic; using UnityEngine; public class UIImgFont : MonoBehaviour { public Dictionary _DictImgChars; public void InitChars() { if (_DictImgChars != null) return; _DictImgChars = new Dictionary(); var childChars = GetComponentsInChildren(); foreach (var childChar in childChars) { _DictImgChars.Add(childChar._Char, childChar); } } }