【spLoader】延时2秒再卸载
parent
43afe3d6f1
commit
fa533f28df
|
@ -52,7 +52,10 @@ end
|
||||||
|
|
||||||
-- 销毁loader
|
-- 销毁loader
|
||||||
function SpriteLoader:Destroy()
|
function SpriteLoader:Destroy()
|
||||||
|
coroutine.start(function()
|
||||||
|
coroutine.wait(2)
|
||||||
self:UnLoadSprite()
|
self:UnLoadSprite()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return SpriteLoader
|
return SpriteLoader
|
|
@ -73,6 +73,7 @@ local index=0
|
||||||
|
|
||||||
|
|
||||||
function GeneralPopup:InitComponent()
|
function GeneralPopup:InitComponent()
|
||||||
|
this.spLoader = SpriteLoader.New()
|
||||||
this.contents=Util.GetGameObject(this.gameObject,"Contents")
|
this.contents=Util.GetGameObject(this.gameObject,"Contents")
|
||||||
this.backBtn=Util.GetGameObject(this.contents,"BG/BackBtn")
|
this.backBtn=Util.GetGameObject(this.contents,"BG/BackBtn")
|
||||||
this.BG=Util.GetGameObject(this.contents,"BG")
|
this.BG=Util.GetGameObject(this.contents,"BG")
|
||||||
|
@ -81,7 +82,6 @@ function GeneralPopup:InitComponent()
|
||||||
--子模块脚本初始化
|
--子模块脚本初始化
|
||||||
for i = 1, #contentScripts do
|
for i = 1, #contentScripts do
|
||||||
contentScripts[i].view:InitComponent(Util.GetGameObject(this.contents, contentScripts[i].panelName))
|
contentScripts[i].view:InitComponent(Util.GetGameObject(this.contents, contentScripts[i].panelName))
|
||||||
this.spLoader = SpriteLoader.New()
|
|
||||||
end
|
end
|
||||||
--预设赋值
|
--预设赋值
|
||||||
for i=1,#contentScripts do
|
for i=1,#contentScripts do
|
||||||
|
@ -152,9 +152,9 @@ function GeneralPopup:OnClose()
|
||||||
end
|
end
|
||||||
|
|
||||||
function GeneralPopup:OnDestroy()
|
function GeneralPopup:OnDestroy()
|
||||||
|
this.spLoader:Destroy()
|
||||||
for i = 1, #contentScripts do
|
for i = 1, #contentScripts do
|
||||||
contentScripts[i].view:OnDestroy()
|
contentScripts[i].view:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -151,9 +151,9 @@ function ResolvePanel:OnClose()
|
||||||
end
|
end
|
||||||
|
|
||||||
function ResolvePanel:OnDestroy()
|
function ResolvePanel:OnDestroy()
|
||||||
|
this.spLoader:Destroy()
|
||||||
for i = 1, #this.contents do
|
for i = 1, #this.contents do
|
||||||
this.contents[i].view:OnDestroy()
|
this.contents[i].view:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue