using System;
|
using System.Collections.Generic;
|
|
/// <summary>
|
/// 平台配置类
|
/// </summary>
|
[Serializable]
|
public class PlatformConfig
|
{
|
/// <summary>平台类型</summary>
|
public PlatformType PlatformType;
|
|
/// <summary>首包大小限制(MB)</summary>
|
public int FirstPackageSizeLimit = 4;
|
|
/// <summary>单个分包大小限制(MB)</summary>
|
public int SubPackageSizeLimit = 20;
|
|
/// <summary>总资源限制(MB)</summary>
|
public int TotalResourceLimit = 50;
|
|
/// <summary>支持的特性列表</summary>
|
public List<string> SupportedFeatures = new List<string>();
|
|
/// <summary>
|
/// 获取微信平台默认配置
|
/// </summary>
|
public static PlatformConfig GetWeChatConfig()
|
{
|
return new PlatformConfig
|
{
|
PlatformType = PlatformType.WeChat,
|
FirstPackageSizeLimit = 4,
|
SubPackageSizeLimit = 20,
|
TotalResourceLimit = 50,
|
SupportedFeatures = new List<string> { "OpenDataContext", "Ad", "Share", "SaveData" }
|
};
|
}
|
|
/// <summary>
|
/// 获取抖音平台默认配置
|
/// </summary>
|
public static PlatformConfig GetDouyinConfig()
|
{
|
return new PlatformConfig
|
{
|
PlatformType = PlatformType.Douyin,
|
FirstPackageSizeLimit = 4,
|
SubPackageSizeLimit = 20,
|
TotalResourceLimit = 50,
|
SupportedFeatures = new List<string> { "Ad", "Share", "SaveData" }
|
};
|
}
|
|
/// <summary>
|
/// 获取vivo平台默认配置
|
/// </summary>
|
public static PlatformConfig GetVivoConfig()
|
{
|
return new PlatformConfig
|
{
|
PlatformType = PlatformType.Vivo,
|
FirstPackageSizeLimit = 10,
|
SubPackageSizeLimit = int.MaxValue,
|
TotalResourceLimit = 100,
|
SupportedFeatures = new List<string> { "SaveData" }
|
};
|
}
|
|
/// <summary>
|
/// 获取编辑器测试配置
|
/// </summary>
|
public static PlatformConfig GetStandaloneConfig()
|
{
|
return new PlatformConfig
|
{
|
PlatformType = PlatformType.Standalone,
|
FirstPackageSizeLimit = int.MaxValue,
|
SubPackageSizeLimit = int.MaxValue,
|
TotalResourceLimit = int.MaxValue,
|
SupportedFeatures = new List<string> { "OpenDataContext", "Ad", "Share", "SaveData" }
|
};
|
}
|
}
|