111
This commit is contained in:
@@ -10,9 +10,11 @@ namespace Stary.Evo.UIFarme
|
||||
/// <summary>
|
||||
/// UI的入栈操作,此操作会显示一个面板
|
||||
/// </summary>
|
||||
Task PushQueue(string prefabName, string packageName = null, Transform parent = null);
|
||||
Task PushQueue(string prefabName, string packageName = null, Transform parent = null,BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade);
|
||||
|
||||
Task PushQueue<T>(string packageName = null, Transform parent = null)
|
||||
|
||||
|
||||
Task PushQueue<T>(string packageName = null, Transform parent = null,BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade)
|
||||
where T : IBaseRenderPanel, new();
|
||||
|
||||
Task PushStack(string prefabName, string packageName = null, Transform parent = null);
|
||||
@@ -30,9 +32,9 @@ namespace Stary.Evo.UIFarme
|
||||
/// <summary>
|
||||
/// 执行面板的出栈操作,此操作会执行面板的OnExit方法
|
||||
/// </summary>
|
||||
void PopQueue(string panelName);
|
||||
void PopQueue(string panelName,BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade);
|
||||
|
||||
void PopQueue<T>() where T : IBaseRenderPanel, new();
|
||||
void PopQueue<T>(BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade) where T : IBaseRenderPanel, new();
|
||||
/// <summary>
|
||||
/// 面板全部出栈此操作会执行面板的OnExit方法
|
||||
/// </summary>
|
||||
@@ -108,7 +110,7 @@ namespace Stary.Evo.UIFarme
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="packageName">非热更模式传null</param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public async Task PushQueue(string prefabName, string packageName = null, Transform parent = null)
|
||||
public async Task PushQueue(string prefabName, string packageName = null, Transform parent = null,BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade)
|
||||
{
|
||||
IBaseRenderPanel nextPanel = null;
|
||||
if (!dicUI.ContainsKey(prefabName))
|
||||
@@ -117,6 +119,7 @@ namespace Stary.Evo.UIFarme
|
||||
nextPanel.UIName = prefabName;
|
||||
await nextPanel.InitializeAsync(this);
|
||||
nextPanel.SetPanelParent(parent);
|
||||
nextPanel.TweenType = tweenType;
|
||||
GameObject panelGo = await nextPanel.CreatePanel(packageName, prefabName);
|
||||
///生成面板后,进行初始化操作
|
||||
await nextPanel.InitializeAsync(panelGo);
|
||||
@@ -146,7 +149,7 @@ namespace Stary.Evo.UIFarme
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="packageName">非热更模式传null</param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public async Task PushQueue<T>(string packageName = null, Transform parent = null)
|
||||
public async Task PushQueue<T>(string packageName = null, Transform parent = null,BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade)
|
||||
where T : IBaseRenderPanel, new()
|
||||
{
|
||||
var prefabName = typeof(T).Name;
|
||||
@@ -157,6 +160,7 @@ namespace Stary.Evo.UIFarme
|
||||
nextPanel = new T();
|
||||
await nextPanel.InitializeAsync(this);
|
||||
nextPanel.SetPanelParent(parent);
|
||||
nextPanel.TweenType = tweenType;
|
||||
GameObject panelGo = await nextPanel.CreatePanel(packageName, nextPanel.UIName);
|
||||
///生成面板后,进行初始化操作
|
||||
await nextPanel.InitializeAsync(panelGo);
|
||||
@@ -273,23 +277,25 @@ namespace Stary.Evo.UIFarme
|
||||
nextPanel.OnEnter();
|
||||
}
|
||||
|
||||
public void PopQueue(string panelName)
|
||||
public void PopQueue(string panelName,BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade)
|
||||
{
|
||||
for (int i = 0; i < queuePanel.Count; i++)
|
||||
{
|
||||
if (queuePanel[i].UIName == panelName)
|
||||
{
|
||||
queuePanel[i].TweenType = tweenType;
|
||||
queuePanel[i].OnExit();
|
||||
queuePanel.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void PopQueue<T>() where T : IBaseRenderPanel, new()
|
||||
public void PopQueue<T>(BaseRenderPanel.UITweenType tweenType = BaseRenderPanel.UITweenType.Fade) where T : IBaseRenderPanel, new()
|
||||
{
|
||||
for (int i = 0; i < queuePanel.Count; i++)
|
||||
{
|
||||
if (queuePanel[i].GetType().Name == typeof(T).Name)
|
||||
{
|
||||
queuePanel[i].TweenType = tweenType;
|
||||
queuePanel[i].OnExit();
|
||||
queuePanel.RemoveAt(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user