diff --git a/Assets/ManagedResources/~Lua/Framework/Manager/PackageManager.lua b/Assets/ManagedResources/~Lua/Framework/Manager/PackageManager.lua index 3964a7283d..6b7d832287 100644 --- a/Assets/ManagedResources/~Lua/Framework/Manager/PackageManager.lua +++ b/Assets/ManagedResources/~Lua/Framework/Manager/PackageManager.lua @@ -96,26 +96,33 @@ end function PackageManager.SetVideo(obj, bg) obj:SetActive(false) - 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(isOk) - if isOk then - 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 = "file://" .. AppConst.PersistentDataPath .."/"..tostring(this.config.VideoName) - video:Play() - bg:DOFade(0, 2) - obj:SetActive(true) - end - else - Log("视频加载失败:"..this.config.VideoName) - end - end) + if ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.IS_PLAY_LOGIN_VIDEO) then + if this.StreamConfig and this.StreamConfig.LoginPanelVideoBG and this.StreamConfig.LoginPanelVideoBG ~= "" then + Log("加载Stream视频:"..tostring(this.StreamConfig.LoginPanelVideoBG)) + if UIManager.IsOpen(UIName.LoginPanel) then + local video = obj:GetComponent("VideoPlayer") + video.url = "file://" .. UnityEngine.Application.streamingAssetsPath .."/Res/"..tostring(this.StreamConfig.LoginPanelVideoBG)..".mp4" + video:Play() + bg:DOFade(0, 2) + obj:SetActive(true) end + elseif this.config and this.config.VideoName and this.config.VideoName ~= "" then + Log("加载视频:"..tostring(this.config.VideoName)) + resMgr:PreLoadAssetAsync(this.config.VideoName, function(isOk) + if isOk then + 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 = "file://" .. AppConst.PersistentDataPath .."/"..tostring(this.config.VideoName) + video:Play() + bg:DOFade(0, 2) + obj:SetActive(true) + end + else + Log("视频加载失败:"..this.config.VideoName) + end + end) else Log("包名:"..tostring(this.config.PackageName).."登录视频为空!") end