using UnityEngine; namespace CreatGame.UI { /// /// 通用的导出预制件的基类 /// public class UIComponentBase : MonoBehaviour { /// /// 窗口预制件 /// protected GameObject m_ComponentObject; /// /// 导出脚本 /// protected UIViewExport m_ViewExport; /// /// 是否加载完成 /// public bool IsPreLoad = false; public virtual void PreLoad(GameObject obj) { m_ComponentObject = obj; m_ViewExport = obj.GetComponent(); IsPreLoad = true; } /// /// /// /// /// protected GameObject GetGameObject(string name) { for (int i = 0; i < m_ViewExport.entries.Count; i++) { if (m_ViewExport.entries[i].key == name) { return m_ViewExport.entries[i].prefab; } } return null; } } }