loading 界面显示修改提交
parent
6b9bcd11bb
commit
cf2ac5c893
|
|
@ -309,7 +309,7 @@ ConfigName = {
|
|||
ArenaRoom = "ArenaRoom",
|
||||
AssistanceConfig = "AssistanceConfig",
|
||||
AssistanceProperty = "AssistanceProperty",
|
||||
|
||||
Loading ="Loading",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ require("Base/BasePanel")
|
|||
LoadingPanel = Inherit(BasePanel)
|
||||
local this = LoadingPanel
|
||||
local tipsConfig = ConfigManager.GetConfig(ConfigName.Tips)
|
||||
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
local loadingConfig=ConfigManager.GetConfig(ConfigName.Loading)
|
||||
--初始化组件(用于子类重写)
|
||||
local spineName=nil
|
||||
local spineObj=nil
|
||||
local configLen=0
|
||||
function LoadingPanel:InitComponent()
|
||||
--
|
||||
this.Slider = Util.GetGameObject(self.gameObject, "Slider"):GetComponent("Slider")
|
||||
|
|
@ -26,6 +27,7 @@ function LoadingPanel:OnOpen(sp)
|
|||
end
|
||||
-- 销毁时回收
|
||||
function LoadingPanel:OnDestroy()
|
||||
|
||||
end
|
||||
local callList = {}
|
||||
local curIndex = 0
|
||||
|
|
@ -76,35 +78,43 @@ function LoadingPanel.Start()
|
|||
-- local index = math.random(1, #sprites)
|
||||
-- spName = sprites[index]
|
||||
-- end
|
||||
|
||||
|
||||
LoadStreamingTexture(this.spLoader, spName, function(sp)
|
||||
--LoadStreamingTexture(this.spLoader, spName, function(sp)
|
||||
if #callList <= 1 then
|
||||
return
|
||||
end
|
||||
local heroConfig
|
||||
for k,v in ConfigPairs(loadingConfig) do
|
||||
configLen=configLen+1
|
||||
end
|
||||
local spineLive=math.random(1,configLen)
|
||||
local curLoad=ConfigManager.TryGetConfigData(ConfigName.Loading,spineLive)
|
||||
if curLoad then
|
||||
if spineObj~=nil and spineName~=nil then
|
||||
poolManager:UnLoadLive(spineName, spineObj, PoolManager.AssetType.GameObject)
|
||||
end
|
||||
heroConfig=ConfigManager.TryGetConfigData(ConfigName.HeroConfig,curLoad.Hero)
|
||||
spName=curLoad.LoadingBG
|
||||
end
|
||||
UIManager.OpenPanel(UIName.LoadingPanel,this.spLoader:LoadSprite(spName))
|
||||
--LogError("heroconfig i================="..heroConfig[10001].Id.." len==="..#heroConfig)
|
||||
local spineLive=math.random(10001,10050)
|
||||
if spineObj~=nil and spineName~=nil then
|
||||
poolManager:UnLoadLive(spineName, spineObj, PoolManager.AssetType.GameObject)
|
||||
end
|
||||
local heroConfig=ConfigManager.TryGetConfigData(ConfigName.HeroConfig,spineLive)
|
||||
if heroConfig then
|
||||
spineName=GetResourcePath(heroConfig.Live)
|
||||
spineObj= poolManager:LoadLive(spineName,this.heroPos.transform, Vector3.one * heroConfig.Scale, Vector3.New(heroConfig.Position[1], heroConfig.Position[2], 0))
|
||||
spineObj.transform:SetParent(this.heroPos.transform)
|
||||
-- spineObj.transform.localPosition = Vector2.New(0, -20)
|
||||
-- spineObj.transform.localScale=Vector3.one
|
||||
end
|
||||
|
||||
if heroConfig then
|
||||
spineName=GetResourcePath(heroConfig.Live)
|
||||
spineObj= poolManager:LoadLive(spineName,this.heroPos.transform, Vector3.one * heroConfig.Scale, Vector3.New(heroConfig.Position[1], heroConfig.Position[2], 0))
|
||||
spineObj.transform:SetParent(this.heroPos.transform)
|
||||
-- spineObj.transform.localPosition = Vector2.New(0, -20)
|
||||
-- spineObj.transform.localScale=Vector3.one
|
||||
end
|
||||
UpdateBeat:Add(update)
|
||||
lerp = 0
|
||||
curIndex = 0
|
||||
this.Slider.maxValue = #callList - 1
|
||||
this.Slider.value = curIndex
|
||||
--"你知道嘛:充值会让你变得更强!" --"白驹工作室倾情奉献"
|
||||
LoadingPanel.OnStep()
|
||||
--end
|
||||
|
||||
UpdateBeat:Add(update)
|
||||
lerp = 0
|
||||
curIndex = 0
|
||||
this.Slider.maxValue = #callList - 1
|
||||
this.Slider.value = curIndex
|
||||
--"你知道嘛:充值会让你变得更强!" --"白驹工作室倾情奉献"
|
||||
LoadingPanel.OnStep()
|
||||
end)
|
||||
--end)
|
||||
end
|
||||
|
||||
function LoadingPanel.End()
|
||||
|
|
|
|||
Loading…
Reference in New Issue