yyl
2026-05-11 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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" }
            };
        }
    }