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