mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -6,14 +6,6 @@ using FairyGUI;
|
||||
|
||||
namespace SHFrame
|
||||
{
|
||||
public enum UILayerEnum
|
||||
{
|
||||
Root, //添加到根节点
|
||||
View,
|
||||
Window,
|
||||
Pop,
|
||||
Guide
|
||||
}
|
||||
|
||||
public class UIModule : Module
|
||||
{
|
||||
@@ -22,9 +14,6 @@ namespace SHFrame
|
||||
public string CurKey { private set; get; } = "";
|
||||
|
||||
private GComponent ViewRoot { get; set; }
|
||||
private GComponent WindowRoot { get; set; }
|
||||
private GComponent PopRoot { get; set; }
|
||||
private GComponent GuideRoot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 游戏框架模块初始化。
|
||||
@@ -48,9 +37,6 @@ namespace SHFrame
|
||||
public void InitUIModule(GComponent view, GComponent window, GComponent pop, GComponent guide)
|
||||
{
|
||||
ViewRoot = view;
|
||||
WindowRoot = window;
|
||||
PopRoot = pop;
|
||||
GuideRoot = guide;
|
||||
}
|
||||
|
||||
public void MakeFullScreen(GObject gObject)
|
||||
@@ -76,9 +62,11 @@ namespace SHFrame
|
||||
/// <param name="resName">ui的resName</param>
|
||||
/// <param name="layer"></param>
|
||||
/// <param name="param"></param>
|
||||
public async UniTask Open<TClassType>(string pkgName, string resName, UILayerEnum layer, params object[] param)
|
||||
public async UniTask Open<TClassType>(string pkgName, string resName, GComponent root = null, params object[] param)
|
||||
where TClassType : UIBase, new()
|
||||
{
|
||||
if (root is null) root = GRoot.inst;
|
||||
|
||||
var key = pkgName + "/" + resName;
|
||||
|
||||
UIMap.TryGetValue(key, out var uiClass);
|
||||
@@ -99,27 +87,6 @@ namespace SHFrame
|
||||
UIMap[key].OnInit();
|
||||
}
|
||||
|
||||
GComponent root;
|
||||
switch (layer)
|
||||
{
|
||||
case UILayerEnum.Root:
|
||||
root = GRoot.inst;
|
||||
break;
|
||||
|
||||
case UILayerEnum.View:
|
||||
root = ViewRoot;
|
||||
break;
|
||||
|
||||
case UILayerEnum.Window:
|
||||
root = WindowRoot;
|
||||
break;
|
||||
case UILayerEnum.Guide:
|
||||
root = GuideRoot;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(layer), layer, null);
|
||||
}
|
||||
|
||||
// root.RemoveChildren();
|
||||
// root.visible = true;
|
||||
// if (root.parent != null)
|
||||
|
Reference in New Issue
Block a user