fix: 修复 CDNLoader 的初始化方法

deeplink
胡宇飞 2024-03-08 21:31:50 +08:00
parent fde37d807a
commit b5576b12a3
1 changed files with 7 additions and 3 deletions

View File

@ -95,11 +95,15 @@ public class CDNLoader : MonoBehaviour
/// 创建Loader
/// </summary>
/// <returns></returns>
public static CDNLoader Create(string remoteKey = "")
public static CDNLoader Create(string defaultValue = "", string remoteKey = "")
{
// 注入自定义的 CDNConfigKey, 可读取自定义的Default配置
if(!string.IsNullOrEmpty(remoteKey)) CDNConfig.CdnConfigRemoteKey = remoteKey;
if(!string.IsNullOrEmpty(remoteKey)) CDNConfig.CdnConfigRemoteKey = remoteKey;
if (!string.IsNullOrEmpty(defaultValue))
{
FirebaseUtil.AppendDefaultValue(remoteKey, defaultValue);
}
var go = new GameObject(nameof(CDNLoader));
var loader = go.AddComponent<CDNLoader>();
return loader;