【 包配置】添加判空
parent
50f10993c4
commit
9bb57b48a5
|
@ -60,29 +60,33 @@ end
|
|||
|
||||
function PackageManager.SetVideo(obj, bg)
|
||||
obj:SetActive(false)
|
||||
if this.config.VideoName then
|
||||
if ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.IS_PLAY_LOGIN_VIDEO) then
|
||||
Log("加载视频:"..tostring(this.config.VideoName))
|
||||
resMgr:PreLoadAssetAsync(this.config.VideoName, function()
|
||||
if UIManager.IsOpen(UIName.LoginPanel) then
|
||||
local video = obj:GetComponent("VideoPlayer")
|
||||
-- video.url = ServerConfigManager.GetVersionInfo("resUrl") .. AppConst.PlatformPath .."/"..tostring(this.config.VideoName) ..".mp4"
|
||||
-- video.clip = resMgr:LoadAsset(this.config.VideoName)
|
||||
video.url = AppConst.PersistentDataPath .."/"..tostring(this.config.VideoName)
|
||||
video:Play()
|
||||
bg:DOFade(0, 2)
|
||||
obj:SetActive(true)
|
||||
end
|
||||
end)
|
||||
if this.config then
|
||||
if this.config.VideoName then
|
||||
if ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.IS_PLAY_LOGIN_VIDEO) then
|
||||
Log("加载视频:"..tostring(this.config.VideoName))
|
||||
resMgr:PreLoadAssetAsync(this.config.VideoName, function()
|
||||
if UIManager.IsOpen(UIName.LoginPanel) then
|
||||
local video = obj:GetComponent("VideoPlayer")
|
||||
-- video.url = ServerConfigManager.GetVersionInfo("resUrl") .. AppConst.PlatformPath .."/"..tostring(this.config.VideoName) ..".mp4"
|
||||
-- video.clip = resMgr:LoadAsset(this.config.VideoName)
|
||||
video.url = AppConst.PersistentDataPath .."/"..tostring(this.config.VideoName)
|
||||
video:Play()
|
||||
bg:DOFade(0, 2)
|
||||
obj:SetActive(true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
else
|
||||
LogError("包名:"..tostring(this.config.PackageName).."登录视频为空!")
|
||||
end
|
||||
else
|
||||
LogError("包名:"..tostring(this.config.PackageName).."登录视频为空!")
|
||||
end
|
||||
end
|
||||
|
||||
function PackageManager.UnloadVideo()
|
||||
if this.config.VideoName then
|
||||
-- Log("卸载视频:"..tostring(this.config.VideoName))
|
||||
-- resMgr:UnLoadAsset(this.config.VideoName)
|
||||
if this.config then
|
||||
if this.config.VideoName then
|
||||
-- Log("卸载视频:"..tostring(this.config.VideoName))
|
||||
-- resMgr:UnLoadAsset(this.config.VideoName)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue