【登陆界面】

dev_chengFeng
ZhangBiao 2021-06-02 18:08:03 +08:00
parent b797a12a87
commit 4ac7dd8159
2 changed files with 24 additions and 16 deletions

View File

@ -43,4 +43,23 @@ function PackageManager.GetLoadingList()
local list = string.split(this.config.LoadingImgList, "#")
return list
end
end
function PackageManager.SetVideo(obj,Image)
local video = obj:GetComponent("VideoPlayer")
if this.config.VideoName then
Image:SetActive(true)
Log("加载视频:"..tostring(this.config.VideoName))
video.clip = resMgr:LoadAsset(this.config.VideoName)
video:Play()
else
LogError("包名:"..tostring(this.config.PackageName).."登录视频为空!")
Image:SetActive(false)
video:Pause()
end
end
function PackageManager.UnloadVideo()
Log("卸载视频:"..tostring(this.config.VideoName))
resMgr:LoadAsset(this.config.VideoName)
end

View File

@ -3,7 +3,6 @@
LoginPanel = Inherit(BasePanel)
local this = LoginPanel
this.LoginWay = { Account = 0, WeChat = 1 }
local PackagerConfig = ConfigManager.GetConfig(ConfigName.PackageConfig)
SERVER_VERSION = tonumber(ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.ServerVersion) or 0)
local ServerVersion = SERVER_VERSION
@ -72,7 +71,8 @@ function this:InitComponent()
this.healthTip = Util.GetGameObject(this.gameObject, "healthTip")
this.healthTip:SetActive(IS_SHOW_HEALTH_TIP)
this.video = Util.GetGameObject(this.gameObject, "bg/GameObject"):GetComponent("VideoPlayer")
this.video = Util.GetGameObject(this.gameObject, "bg/GameObject")
this.rawImage = Util.GetGameObject(this.gameObject, "bg/RawImage")
end
--绑定事件(用于子类重写)
@ -195,19 +195,8 @@ end
--界面打开时调用(用于子类重写)
function this:OnOpen(...)
for _, config in ConfigPairs(PackagerConfig) do
if config.PackageName == PackageManager.PackageName then
if not config.VideoName or config.VideoName == "" then
LogError("包名:"..tostring(config.PackageName).."登录视频为空!")
else
Log("加载视频:"..tostring(config.VideoName))
this.VideoName = config.VideoName
this.video.clip = resMgr:LoadAsset(config.VideoName)
this.video:Play()
end
break
end
end
--设置背景
PackageManager.SetVideo(this.video,this.rawImage)
if AppConst.Code ~= "" then
MsgPanel.ShowOne(GetLanguageStrById(AppConst.Code))
AppConst.Code = ""
@ -282,7 +271,7 @@ end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
this.spLoader:Destroy()
resMgr:UnLoadAsset(this.VideoName)
PackageManager.UnloadVideo()
end
this.isWaiting = false