65 lines
1.8 KiB
Lua
65 lines
1.8 KiB
Lua
PackageManager = {}
|
|
local this = PackageManager
|
|
function PackageManager.Initialize()
|
|
this.PackageName = "test"
|
|
if AppConst.isSDK then
|
|
this.PackageName = AndroidDeviceInfo.Instance:GetPackageName()
|
|
end
|
|
LogGreen("当前包名为:"..this.PackageName)
|
|
local PackagerConfig = ConfigManager.GetConfig(ConfigName.PackageConfig)
|
|
for _, config in ConfigPairs(PackagerConfig) do
|
|
if config.PackageName == this.PackageName then
|
|
this.config = config
|
|
break
|
|
end
|
|
end
|
|
end
|
|
|
|
-- 获取包名
|
|
function PackageManager.GetPackageName()
|
|
return this.PackageName
|
|
end
|
|
-- 获取充值计费点字段
|
|
function PackageManager.GetRechargeField()
|
|
if this.config then
|
|
return this.config.RechargeField
|
|
end
|
|
end
|
|
-- 获取登录背景图
|
|
function PackageManager.GetLoginPanelBg()
|
|
if this.config then
|
|
return this.config.LoginPanelBg
|
|
end
|
|
end
|
|
-- 获取充值计费点字段
|
|
function PackageManager.GetCustomEventField()
|
|
if this.config then
|
|
return this.config.CustomEventField
|
|
end
|
|
end
|
|
-- 获取loading图list
|
|
function PackageManager.GetLoadingList()
|
|
if this.config then
|
|
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 |