using System; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public abstract class UI_Base : MonoBehaviour { protected Dictionary _objects = new Dictionary(); protected bool _init = false; public virtual bool Init() { if (_init) return false; return _init = true; } private void Start() { Init(); } protected void Bind(Type type) where T : UnityEngine.Object { string[] names = Enum.GetNames(type); UnityEngine.Object[] objects = new UnityEngine.Object[names.Length]; _objects.Add(typeof(T), objects); for (int i = 0; i < names.Length; i++) { if (typeof(T) == typeof(GameObject)) objects[i] = Utils.FindChild(gameObject, names[i], true); else objects[i] = Utils.FindChild(gameObject, names[i], true); if (objects[i] == null) Debug.Log($"Failed to bind({names[i]})"); } } protected void BindObject(Type type) { Bind(type); } protected void BindImage(Type type) { Bind(type); } protected void BindText(Type type) { Bind(type); } protected void BindButton(Type type) { Bind