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