From 04511de9f57758f93033562ddb32cea265cfe280 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 22 Jan 2021 16:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91LOADING?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=9B=BE=E5=92=8CTIPS=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E5=A4=9A=E4=B8=80=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Message/LoadingPanel.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Message/LoadingPanel.lua b/Assets/ManagedResources/~Lua/Modules/Message/LoadingPanel.lua index f70d0e81a3..7c0a27da3f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Message/LoadingPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Message/LoadingPanel.lua @@ -1,17 +1,25 @@ require("Base/BasePanel") LoadingPanel = Inherit(BasePanel) local this = LoadingPanel +local sprites = {"loding1"} --初始化组件(用于子类重写) function LoadingPanel:InitComponent() Log("LoadingPanel:InitComponent") this.Slider = Util.GetGameObject(self.gameObject, "Slider"):GetComponent("Slider") this.Tip = Util.GetGameObject(self.gameObject, "Slider/Image/LoadingText"):GetComponent("Text") this.SliderText = Util.GetGameObject(self.gameObject, "Slider/Fill Area/Fill/Image/Text"):GetComponent("Text") - + this.bg = Util.GetGameObject(self.gameObject, "bg1"):GetComponent("Image") screenAdapte(Util.GetGameObject(self.gameObject, "bg1")) screenAdapte(Util.GetGameObject(self.gameObject, "bg2")) end +function LoadingPanel:OnOpen() + local index = 0 + math.randomseed(os.time()) + index = math.random(1, #sprites) + this.bg.sprite = Util.LoadSprite(sprites[index]) +end + local callList = {} local curIndex = 0 local lerp = 0 @@ -30,7 +38,7 @@ end function LoadingPanel.AddStep(func) table.insert(callList, func) maxIndex = maxIndex + 1 -end +end function LoadingPanel.OnStep() lerp = 0