|
@@ -175,6 +175,7 @@ namespace Fort23.Mono
|
|
UILayers[3] = prefab.transform.GetChild(3);
|
|
UILayers[3] = prefab.transform.GetChild(3);
|
|
UICamera = prefab.transform.GetComponentInChildren<Camera>();
|
|
UICamera = prefab.transform.GetComponentInChildren<Camera>();
|
|
}
|
|
}
|
|
|
|
+
|
|
current = EventSystem.current;
|
|
current = EventSystem.current;
|
|
Assembly assembly = Assembly.Load("Fort23.Mono");
|
|
Assembly assembly = Assembly.Load("Fort23.Mono");
|
|
BackgroundPanelType = assembly.GetType(" Fort23.Mono.BackgroundPanel");
|
|
BackgroundPanelType = assembly.GetType(" Fort23.Mono.BackgroundPanel");
|
|
@@ -238,7 +239,7 @@ namespace Fort23.Mono
|
|
|
|
|
|
public void SetEventSystemEnable(bool value)
|
|
public void SetEventSystemEnable(bool value)
|
|
{
|
|
{
|
|
- if(current != null)
|
|
|
|
|
|
+ if (current != null)
|
|
current.enabled = value;
|
|
current.enabled = value;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -335,7 +336,8 @@ namespace Fort23.Mono
|
|
_lastShowPanel.Clear();
|
|
_lastShowPanel.Clear();
|
|
}
|
|
}
|
|
|
|
|
|
- public async CTask<UIPanel> LoadAndOpenPanel(Type uipsnelType, Action<UIPanel> callback, UILayer layer = UILayer.Middle,
|
|
|
|
|
|
+ public async CTask<UIPanel> LoadAndOpenPanel(Type uipsnelType, Action<UIPanel> callback,
|
|
|
|
+ UILayer layer = UILayer.Middle,
|
|
bool isFocus = true, object[] uiData = null, bool isShowBG = false, bool isFullUI = false,
|
|
bool isFocus = true, object[] uiData = null, bool isShowBG = false, bool isFullUI = false,
|
|
bool isActiveAnima = true)
|
|
bool isActiveAnima = true)
|
|
{
|
|
{
|
|
@@ -360,7 +362,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = true;
|
|
|
|
|
|
+ SetEventSystemEnable(false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -437,7 +439,7 @@ namespace Fort23.Mono
|
|
|
|
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = false;
|
|
|
|
|
|
+ SetEventSystemEnable(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -448,13 +450,13 @@ namespace Fort23.Mono
|
|
RefreshFull();
|
|
RefreshFull();
|
|
|
|
|
|
|
|
|
|
- if (isShowBG)
|
|
|
|
- {
|
|
|
|
- uiPanel.IsShowCustomBGPanel = true;
|
|
|
|
- if (!AllShowBGUIs.Contains(uiPanel))
|
|
|
|
- AllShowBGUIs.Add(uiPanel);
|
|
|
|
- await GetBackgroundPanel(uiPanel, GetLayer(layer));
|
|
|
|
- }
|
|
|
|
|
|
+ // if (isShowBG)
|
|
|
|
+ // {
|
|
|
|
+ // uiPanel.IsShowCustomBGPanel = true;
|
|
|
|
+ // if (!AllShowBGUIs.Contains(uiPanel))
|
|
|
|
+ // AllShowBGUIs.Add(uiPanel);
|
|
|
|
+ // await GetBackgroundPanel(uiPanel, GetLayer(layer));
|
|
|
|
+ // }
|
|
|
|
|
|
return uiPanel;
|
|
return uiPanel;
|
|
}
|
|
}
|
|
@@ -462,7 +464,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = false;
|
|
|
|
|
|
+ SetEventSystemEnable(true);
|
|
}
|
|
}
|
|
|
|
|
|
// 界面数据没准备好,因此本次操作将被销毁
|
|
// 界面数据没准备好,因此本次操作将被销毁
|
|
@@ -477,7 +479,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = false;
|
|
|
|
|
|
+ SetEventSystemEnable(true);
|
|
}
|
|
}
|
|
|
|
|
|
LogTool.Error(uipsnelType.ToString() + " " + e.Message);
|
|
LogTool.Error(uipsnelType.ToString() + " " + e.Message);
|
|
@@ -538,6 +540,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
|
|
+ SetEventSystemEnable(false);
|
|
// current.isClose = true;
|
|
// current.isClose = true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -574,6 +577,15 @@ namespace Fort23.Mono
|
|
}
|
|
}
|
|
|
|
|
|
uiPanel.isFullUI = isFullUI;
|
|
uiPanel.isFullUI = isFullUI;
|
|
|
|
+
|
|
|
|
+ if (isShowBG)
|
|
|
|
+ {
|
|
|
|
+ uiPanel.IsShowCustomBGPanel = true;
|
|
|
|
+ if (!AllShowBGUIs.Contains(uiPanel))
|
|
|
|
+ AllShowBGUIs.Add(uiPanel);
|
|
|
|
+ await GetBackgroundPanel(uiPanel, GetLayer(layer));
|
|
|
|
+ }
|
|
|
|
+
|
|
// 等待数据准备好才初始化UI
|
|
// 等待数据准备好才初始化UI
|
|
if (await uiPanel.AsyncInit(uiData))
|
|
if (await uiPanel.AsyncInit(uiData))
|
|
{
|
|
{
|
|
@@ -607,15 +619,11 @@ namespace Fort23.Mono
|
|
NoFocusTopUIPanels.Add(uiPanel);
|
|
NoFocusTopUIPanels.Add(uiPanel);
|
|
uiPanel.isActiveAnima = isActiveAnima;
|
|
uiPanel.isActiveAnima = isActiveAnima;
|
|
await uiPanel.Open();
|
|
await uiPanel.Open();
|
|
- // AudioManager.Instance.PlayAudio("openui.wav");
|
|
|
|
- // if (currOpenPanel.add)
|
|
|
|
- // {
|
|
|
|
- // currOpenPanel = uiPanel;
|
|
|
|
- // }
|
|
|
|
|
|
+
|
|
|
|
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = false;
|
|
|
|
|
|
+ SetEventSystemEnable(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -626,14 +634,14 @@ namespace Fort23.Mono
|
|
RefreshFull();
|
|
RefreshFull();
|
|
|
|
|
|
|
|
|
|
- if (isShowBG)
|
|
|
|
- {
|
|
|
|
- // await TimerComponent.Instance.WaitFrameAsync();
|
|
|
|
- uiPanel.IsShowCustomBGPanel = true;
|
|
|
|
- if (!AllShowBGUIs.Contains(uiPanel))
|
|
|
|
- AllShowBGUIs.Add(uiPanel);
|
|
|
|
- await GetBackgroundPanel(uiPanel, GetLayer(layer));
|
|
|
|
- }
|
|
|
|
|
|
+ // if (isShowBG)
|
|
|
|
+ // {
|
|
|
|
+ //
|
|
|
|
+ // uiPanel.IsShowCustomBGPanel = true;
|
|
|
|
+ // if (!AllShowBGUIs.Contains(uiPanel))
|
|
|
|
+ // AllShowBGUIs.Add(uiPanel);
|
|
|
|
+ // await GetBackgroundPanel(uiPanel, GetLayer(layer));
|
|
|
|
+ // }
|
|
|
|
|
|
return uiPanel;
|
|
return uiPanel;
|
|
}
|
|
}
|
|
@@ -641,12 +649,12 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = false;
|
|
|
|
|
|
+ SetEventSystemEnable(true);
|
|
}
|
|
}
|
|
|
|
|
|
// 界面数据没准备好,因此本次操作将被销毁
|
|
// 界面数据没准备好,因此本次操作将被销毁
|
|
LogTool.Log($"数据准备失败,请检查{type.Name}的Init方法中的逻辑");
|
|
LogTool.Log($"数据准备失败,请检查{type.Name}的Init方法中的逻辑");
|
|
- // ShowTips($"数据准备失败,请检查{buildType.Name}的Init方法中的逻辑");
|
|
|
|
|
|
+
|
|
uiPanel.Close();
|
|
uiPanel.Close();
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -656,7 +664,7 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
if (current != null)
|
|
if (current != null)
|
|
{
|
|
{
|
|
- // current.isClose = false;
|
|
|
|
|
|
+ SetEventSystemEnable(true);
|
|
}
|
|
}
|
|
|
|
|
|
LogTool.Error(typeof(T).ToString() + " " + e.Message);
|
|
LogTool.Error(typeof(T).ToString() + " " + e.Message);
|
|
@@ -1334,12 +1342,13 @@ namespace Fort23.Mono
|
|
{
|
|
{
|
|
popupPanel = Instance.GetComponent(BackgroundPanelType) as UIPanel;
|
|
popupPanel = Instance.GetComponent(BackgroundPanelType) as UIPanel;
|
|
}
|
|
}
|
|
|
|
+
|
|
popupPanel.transform.SetParent(parent, false);
|
|
popupPanel.transform.SetParent(parent, false);
|
|
popupPanel.transform.SetAsFirstSibling();
|
|
popupPanel.transform.SetAsFirstSibling();
|
|
int index01 = uiPanel.GObjectPoolInterface.transform.GetSiblingIndex();
|
|
int index01 = uiPanel.GObjectPoolInterface.transform.GetSiblingIndex();
|
|
// popupPanel.transform.SetParent(parent, false);
|
|
// popupPanel.transform.SetParent(parent, false);
|
|
-
|
|
|
|
- popupPanel.transform.SetSiblingIndex(index01-1 );
|
|
|
|
|
|
+
|
|
|
|
+ popupPanel.transform.SetSiblingIndex(index01 - 1);
|
|
await popupPanel.Open();
|
|
await popupPanel.Open();
|
|
|
|
|
|
return popupPanel;
|
|
return popupPanel;
|