using UnityEngine; namespace CreatGame.UI { public class UIViewBase { /// /// 预制件的路径 /// public virtual string PrefabPath { get; set; } /// /// 窗口预制件 /// protected GameObject m_ViewObject; /// /// 导出脚本 /// protected UIExportTool m_ExportTool; /// /// 加载窗口的时候需要预先加载的东西 /// public virtual void PreLoad(GameObject viewObject) { m_ViewObject = viewObject; m_ExportTool = viewObject.GetComponent(); } /// /// 初始化界面 /// public virtual void InitView() { } /// /// 关闭窗口的时候的调用 /// public virtual void CloseView() { } protected GameObject GetGameObject(string name) { for (int i = 0; i < m_ExportTool.entries.Count; i++) { if (m_ExportTool.entries[i].key == name) { return m_ExportTool.entries[i].prefab; } } return null; } } }