添加界面加载过程的日志
parent
661ee1f796
commit
aca5c4683c
|
@ -318,6 +318,7 @@ local SetSortingOrder = function(uiConfig, panel, isStackPanel, ...)
|
|||
end
|
||||
|
||||
function UIManager.GetPanel(id, isSync, func, ...)
|
||||
Log("UIManager GetPanel id = "..id)
|
||||
local uiConfig = UIConfig[id]
|
||||
if(uiConfig == nil) then
|
||||
LogError("UIManager====>没有找到UI的配置信息:"..id)
|
||||
|
@ -331,16 +332,19 @@ function UIManager.GetPanel(id, isSync, func, ...)
|
|||
panel = list[i]
|
||||
--如果找到了,从桟中移除
|
||||
table.remove(list, i)
|
||||
Log("UIManager Stack Remove id = "..id)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local args = {...}
|
||||
local action = function(panel)
|
||||
Log("UIManager Action id = "..id)
|
||||
if not panel then --在缓存里面找一找
|
||||
panel = this.openedList[uiConfig.id]
|
||||
end
|
||||
if not panel then
|
||||
Log("UIManager reimport id = "..id)
|
||||
panel = reimport("Modules/"..uiConfig.script)
|
||||
this.openedList[uiConfig.id] = panel
|
||||
panel.uiConfig = uiConfig
|
||||
|
@ -354,13 +358,15 @@ function UIManager.GetPanel(id, isSync, func, ...)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
if isSync then
|
||||
Log("UIManager CreateUI id = "..id)
|
||||
local gameObject = this.CreatePanel(uiConfig, rootNode)
|
||||
panel:CreateUI(gameObject)
|
||||
else
|
||||
Log("UIManager Async CreateUI id = "..id)
|
||||
this.CreatePanelAsync(uiConfig, rootNode, function (gameObject)
|
||||
panel:CreateUI(gameObject)
|
||||
Log("UIManager Async SetSortingOrder id = "..id)
|
||||
SetSortingOrder(uiConfig, panel, isStackPanel,unpack(args, 1, table.maxn(args)))
|
||||
if func then
|
||||
func(panel)
|
||||
|
@ -368,6 +374,8 @@ function UIManager.GetPanel(id, isSync, func, ...)
|
|||
end)
|
||||
end
|
||||
end
|
||||
|
||||
Log("UIManager SetSortingOrder id = "..id)
|
||||
if isSync then
|
||||
SetSortingOrder(uiConfig, panel, isStackPanel,unpack(args, 1, table.maxn(args)))
|
||||
return panel
|
||||
|
@ -378,7 +386,10 @@ function UIManager.GetPanel(id, isSync, func, ...)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
if isStackPanel and uiConfig.type == UIType.FullType then --如果栈界面有需要播放关闭动画的界面,则新打开的界面需要等到关闭动画播放完成以后
|
||||
|
||||
Log("UIManager Wait Anim Close id = "..id)
|
||||
local closeNum = 0
|
||||
local closeTotal = 0
|
||||
for i = 1, #this.stackList do
|
||||
|
@ -387,6 +398,7 @@ function UIManager.GetPanel(id, isSync, func, ...)
|
|||
this.stackList[i]:OnCloseBefore(function()
|
||||
closeNum = closeNum + 1
|
||||
if closeNum == closeTotal then
|
||||
Log("UIManager Close Done id = "..id)
|
||||
this.eventSystem:SetActive(true)
|
||||
return action(panel)
|
||||
end
|
||||
|
@ -394,6 +406,7 @@ function UIManager.GetPanel(id, isSync, func, ...)
|
|||
end
|
||||
end
|
||||
if closeTotal == 0 then
|
||||
Log("UIManager No Wait id = "..id)
|
||||
return action(panel)
|
||||
else
|
||||
this.eventSystem:SetActive(false)
|
||||
|
|
Loading…
Reference in New Issue