【登陆界面】
parent
b797a12a87
commit
4ac7dd8159
|
@ -43,4 +43,23 @@ function PackageManager.GetLoadingList()
|
||||||
local list = string.split(this.config.LoadingImgList, "#")
|
local list = string.split(this.config.LoadingImgList, "#")
|
||||||
return list
|
return list
|
||||||
end
|
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
|
end
|
|
@ -3,7 +3,6 @@
|
||||||
LoginPanel = Inherit(BasePanel)
|
LoginPanel = Inherit(BasePanel)
|
||||||
local this = LoginPanel
|
local this = LoginPanel
|
||||||
this.LoginWay = { Account = 0, WeChat = 1 }
|
this.LoginWay = { Account = 0, WeChat = 1 }
|
||||||
local PackagerConfig = ConfigManager.GetConfig(ConfigName.PackageConfig)
|
|
||||||
|
|
||||||
SERVER_VERSION = tonumber(ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.ServerVersion) or 0)
|
SERVER_VERSION = tonumber(ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.ServerVersion) or 0)
|
||||||
local ServerVersion = SERVER_VERSION
|
local ServerVersion = SERVER_VERSION
|
||||||
|
@ -72,7 +71,8 @@ function this:InitComponent()
|
||||||
this.healthTip = Util.GetGameObject(this.gameObject, "healthTip")
|
this.healthTip = Util.GetGameObject(this.gameObject, "healthTip")
|
||||||
this.healthTip:SetActive(IS_SHOW_HEALTH_TIP)
|
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
|
end
|
||||||
|
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
|
@ -195,19 +195,8 @@ end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function this:OnOpen(...)
|
function this:OnOpen(...)
|
||||||
for _, config in ConfigPairs(PackagerConfig) do
|
--设置背景
|
||||||
if config.PackageName == PackageManager.PackageName then
|
PackageManager.SetVideo(this.video,this.rawImage)
|
||||||
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
|
|
||||||
if AppConst.Code ~= "" then
|
if AppConst.Code ~= "" then
|
||||||
MsgPanel.ShowOne(GetLanguageStrById(AppConst.Code))
|
MsgPanel.ShowOne(GetLanguageStrById(AppConst.Code))
|
||||||
AppConst.Code = ""
|
AppConst.Code = ""
|
||||||
|
@ -282,7 +271,7 @@ end
|
||||||
--界面销毁时调用(用于子类重写)
|
--界面销毁时调用(用于子类重写)
|
||||||
function this:OnDestroy()
|
function this:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
resMgr:UnLoadAsset(this.VideoName)
|
PackageManager.UnloadVideo()
|
||||||
end
|
end
|
||||||
|
|
||||||
this.isWaiting = false
|
this.isWaiting = false
|
||||||
|
|
Loading…
Reference in New Issue