UGUI导出工具
This commit is contained in:
@@ -1,15 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CreatGame.UI
|
||||
{
|
||||
public class UIManager : Singleton<UIManager>
|
||||
{
|
||||
private Dictionary<UILayer,GameObject> m_UILayers;
|
||||
private Dictionary<UILayer, Queue<UIViewBase>> m_Windows;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public UIManager()
|
||||
{
|
||||
m_UILayers = new Dictionary<UILayer, GameObject>();
|
||||
m_Windows = new Dictionary<UILayer, Queue<UIViewBase>>();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="layer"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public UIViewBase OpenView<T>(UILayer layer) where T : UIViewBase , new()
|
||||
{
|
||||
var view = new T();
|
||||
|
||||
view.PreLoad();
|
||||
view.InitView();
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,29 @@
|
||||
{
|
||||
public class UIViewBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 预制件的路径
|
||||
/// </summary>
|
||||
public virtual string PrefabPath { get; set; }
|
||||
/// <summary>
|
||||
/// 加载窗口的时候需要预先加载的东西
|
||||
/// </summary>
|
||||
public virtual void PreLoad()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化界面
|
||||
/// </summary>
|
||||
public virtual void InitView()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 关闭窗口的时候的调用
|
||||
/// </summary>
|
||||
public virtual void CloseView()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user