com.typhoon.unitysdk 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -141,6 +141,8 @@ namespace TyphoonUnitySDK
141
141
  PlayerSettings.Android.minSdkVersion = setting.MinApiVersion;
142
142
  PlayerSettings.Android.targetSdkVersion = setting.TargetApiVersion;
143
143
 
144
+
145
+
144
146
  //覆写GraphicsAPI
145
147
  if (setting.GraphicsAPIs.Length > 0)
146
148
  {
@@ -202,6 +204,9 @@ namespace TyphoonUnitySDK
202
204
  }
203
205
  }
204
206
 
207
+ PlayerSettings.WebGL.exceptionSupport = setting.ExceptionSupport;
208
+ PlayerSettings.WebGL.debugSymbols = setting.WebglDebugSymbols;
209
+
205
210
  //覆写AA参数
206
211
  AddressableSupport.ModifyAAProfileAndVariables(setting);
207
212
  //写入App config
@@ -434,6 +439,8 @@ namespace TyphoonUnitySDK
434
439
  ClearFilesInDirectory(folder, manifest);
435
440
  }
436
441
 
442
+ AssetDatabase.ImportAsset($"Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid",
443
+ ImportAssetOptions.ImportRecursive);
437
444
  AssetDatabase.Refresh();
438
445
  }
439
446
  }
@@ -471,6 +478,8 @@ namespace TyphoonUnitySDK
471
478
  ClearFilesInDirectory(folder, manifest);
472
479
  }
473
480
 
481
+ AssetDatabase.ImportAsset($"Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini",
482
+ ImportAssetOptions.ImportRecursive);
474
483
  AssetDatabase.Refresh();
475
484
  }
476
485
  }
@@ -491,6 +500,8 @@ namespace TyphoonUnitySDK
491
500
  ClearFilesInDirectory(folder, manifest);
492
501
  }
493
502
 
503
+ AssetDatabase.ImportAsset($"Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin",
504
+ ImportAssetOptions.ImportRecursive);
494
505
  AssetDatabase.Refresh();
495
506
  }
496
507
  }
@@ -511,6 +522,8 @@ namespace TyphoonUnitySDK
511
522
  ClearFilesInDirectory(folder, manifest);
512
523
  }
513
524
 
525
+ AssetDatabase.ImportAsset($"Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay",
526
+ ImportAssetOptions.ImportRecursive);
514
527
  AssetDatabase.Refresh();
515
528
  }
516
529
  }
@@ -533,6 +546,8 @@ namespace TyphoonUnitySDK
533
546
  ClearFilesInDirectory(folder, manifest);
534
547
  }
535
548
 
549
+ AssetDatabase.ImportAsset($"Assets/Typhoon_Gen/TyphoonSDK/Runtime/VivoMini",
550
+ ImportAssetOptions.ImportRecursive);
536
551
  AssetDatabase.Refresh();
537
552
  }
538
553
  }
@@ -76,6 +76,9 @@ public AndroidSdkVersions MinApiVersion = AndroidSdkVersions.AndroidApiLevel22;
76
76
  public WebGlTemplate WebglTemplate = WebGlTemplate.Minimal;
77
77
  public bool OverrideWebglCompressionFormat = false;
78
78
  public WebGLCompressionFormat CompressionFormat = WebGLCompressionFormat.Gzip;
79
+ public WebGLExceptionSupport ExceptionSupport = WebGLExceptionSupport.FullWithoutStacktrace;
80
+ public bool WebglDebugSymbols = false;
81
+
79
82
 
80
83
  [FormerlySerializedAs("EnableAASupport")] [FormerlySerializedAs("EnableAddressableSupport")] [Header("AA相关")]
81
84
  /*AA相关*/
@@ -40,6 +40,10 @@ namespace TyphoonUnitySDK
40
40
  { nameof(PublishSetting.WebglTemplate), DrawProperty_WebglTemplate },
41
41
  { nameof(PublishSetting.OverrideWebglCompressionFormat), DrawProperty_OverrideWebglCompressionFormat },
42
42
  { nameof(PublishSetting.CompressionFormat), DrawProperty_CompressionFormat },
43
+ { nameof(PublishSetting.ExceptionSupport), DrawProperty_ExceptionSupport },
44
+ { nameof(PublishSetting.WebglDebugSymbols), DrawProperty_WebglDebugSymbols },
45
+
46
+
43
47
  { nameof(PublishSetting.ArmV7), DrawProperty_ArmV7 },
44
48
  { nameof(PublishSetting.ArmV64), DrawProperty_ArmV64 },
45
49
  { nameof(PublishSetting.MinApiVersion), DrawProperty_MinApiVersion },
@@ -52,6 +56,28 @@ namespace TyphoonUnitySDK
52
56
  { nameof(PublishSetting.VivoMiniGUIFoldout), DrawProperty_VivoMiniGUIFoldout },
53
57
  };
54
58
 
59
+
60
+ private static bool DrawProperty_ExceptionSupport(PublishSetting arg)
61
+ {
62
+ if (arg.BuildTarget != BuildTarget.WebGL)
63
+ {
64
+ return true;
65
+ }
66
+
67
+ return false;
68
+ }
69
+
70
+ private static bool DrawProperty_WebglDebugSymbols(PublishSetting arg)
71
+ {
72
+ if (arg.BuildTarget != BuildTarget.WebGL)
73
+ {
74
+ return true;
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+
55
81
  private static bool DrawProperty_VivoMiniGUIFoldout(PublishSetting arg)
56
82
  {
57
83
  if (arg.Channel != AppChannel.VivoMini)
Binary file
@@ -0,0 +1,144 @@
1
+ fileFormatVersion: 2
2
+ guid: dc3d17ad3f82a494a9c2626cc86c75b0
3
+ TextureImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 11
7
+ mipmaps:
8
+ mipMapMode: 0
9
+ enableMipMap: 1
10
+ sRGBTexture: 1
11
+ linearTexture: 0
12
+ fadeOut: 0
13
+ borderMipMap: 0
14
+ mipMapsPreserveCoverage: 0
15
+ alphaTestReferenceValue: 0.5
16
+ mipMapFadeDistanceStart: 1
17
+ mipMapFadeDistanceEnd: 3
18
+ bumpmap:
19
+ convertToNormalMap: 0
20
+ externalNormalMap: 0
21
+ heightScale: 0.25
22
+ normalMapFilter: 0
23
+ isReadable: 0
24
+ streamingMipmaps: 0
25
+ streamingMipmapsPriority: 0
26
+ vTOnly: 0
27
+ grayScaleToAlpha: 0
28
+ generateCubemap: 6
29
+ cubemapConvolution: 0
30
+ seamlessCubemap: 0
31
+ textureFormat: 1
32
+ maxTextureSize: 2048
33
+ textureSettings:
34
+ serializedVersion: 2
35
+ filterMode: 1
36
+ aniso: 1
37
+ mipBias: 0
38
+ wrapU: 0
39
+ wrapV: 0
40
+ wrapW: 0
41
+ nPOTScale: 1
42
+ lightmap: 0
43
+ compressionQuality: 50
44
+ spriteMode: 0
45
+ spriteExtrude: 1
46
+ spriteMeshType: 1
47
+ alignment: 0
48
+ spritePivot: {x: 0.5, y: 0.5}
49
+ spritePixelsToUnits: 100
50
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
51
+ spriteGenerateFallbackPhysicsShape: 1
52
+ alphaUsage: 1
53
+ alphaIsTransparency: 1
54
+ spriteTessellationDetail: -1
55
+ textureType: 0
56
+ textureShape: 1
57
+ singleChannelComponent: 0
58
+ flipbookRows: 1
59
+ flipbookColumns: 1
60
+ maxTextureSizeSet: 0
61
+ compressionQualitySet: 0
62
+ textureFormatSet: 0
63
+ ignorePngGamma: 0
64
+ applyGammaDecoding: 0
65
+ platformSettings:
66
+ - serializedVersion: 3
67
+ buildTarget: DefaultTexturePlatform
68
+ maxTextureSize: 2048
69
+ resizeAlgorithm: 0
70
+ textureFormat: -1
71
+ textureCompression: 1
72
+ compressionQuality: 50
73
+ crunchedCompression: 0
74
+ allowsAlphaSplitting: 0
75
+ overridden: 0
76
+ androidETC2FallbackOverride: 0
77
+ forceMaximumCompressionQuality_BC6H_BC7: 0
78
+ - serializedVersion: 3
79
+ buildTarget: Standalone
80
+ maxTextureSize: 2048
81
+ resizeAlgorithm: 0
82
+ textureFormat: -1
83
+ textureCompression: 1
84
+ compressionQuality: 50
85
+ crunchedCompression: 0
86
+ allowsAlphaSplitting: 0
87
+ overridden: 0
88
+ androidETC2FallbackOverride: 0
89
+ forceMaximumCompressionQuality_BC6H_BC7: 0
90
+ - serializedVersion: 3
91
+ buildTarget: iPhone
92
+ maxTextureSize: 2048
93
+ resizeAlgorithm: 0
94
+ textureFormat: -1
95
+ textureCompression: 1
96
+ compressionQuality: 50
97
+ crunchedCompression: 0
98
+ allowsAlphaSplitting: 0
99
+ overridden: 0
100
+ androidETC2FallbackOverride: 0
101
+ forceMaximumCompressionQuality_BC6H_BC7: 0
102
+ - serializedVersion: 3
103
+ buildTarget: WebGL
104
+ maxTextureSize: 2048
105
+ resizeAlgorithm: 0
106
+ textureFormat: -1
107
+ textureCompression: 1
108
+ compressionQuality: 50
109
+ crunchedCompression: 0
110
+ allowsAlphaSplitting: 0
111
+ overridden: 0
112
+ androidETC2FallbackOverride: 0
113
+ forceMaximumCompressionQuality_BC6H_BC7: 0
114
+ - serializedVersion: 3
115
+ buildTarget: Android
116
+ maxTextureSize: 2048
117
+ resizeAlgorithm: 0
118
+ textureFormat: -1
119
+ textureCompression: 1
120
+ compressionQuality: 50
121
+ crunchedCompression: 0
122
+ allowsAlphaSplitting: 0
123
+ overridden: 0
124
+ androidETC2FallbackOverride: 0
125
+ forceMaximumCompressionQuality_BC6H_BC7: 0
126
+ spriteSheet:
127
+ serializedVersion: 2
128
+ sprites: []
129
+ outline: []
130
+ physicsShape: []
131
+ bones: []
132
+ spriteID:
133
+ internalID: 0
134
+ vertices: []
135
+ indices:
136
+ edges: []
137
+ weights: []
138
+ secondaryTextures: []
139
+ spritePackingTag:
140
+ pSDRemoveMatte: 0
141
+ pSDShowRemoveMatteOption: 0
142
+ userData:
143
+ assetBundleName:
144
+ assetBundleVariant:
Binary file
@@ -0,0 +1,144 @@
1
+ fileFormatVersion: 2
2
+ guid: d731e6be9bb840742ae89b02aac26ce1
3
+ TextureImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 11
7
+ mipmaps:
8
+ mipMapMode: 0
9
+ enableMipMap: 1
10
+ sRGBTexture: 1
11
+ linearTexture: 0
12
+ fadeOut: 0
13
+ borderMipMap: 0
14
+ mipMapsPreserveCoverage: 0
15
+ alphaTestReferenceValue: 0.5
16
+ mipMapFadeDistanceStart: 1
17
+ mipMapFadeDistanceEnd: 3
18
+ bumpmap:
19
+ convertToNormalMap: 0
20
+ externalNormalMap: 0
21
+ heightScale: 0.25
22
+ normalMapFilter: 0
23
+ isReadable: 0
24
+ streamingMipmaps: 0
25
+ streamingMipmapsPriority: 0
26
+ vTOnly: 0
27
+ grayScaleToAlpha: 0
28
+ generateCubemap: 6
29
+ cubemapConvolution: 0
30
+ seamlessCubemap: 0
31
+ textureFormat: 1
32
+ maxTextureSize: 2048
33
+ textureSettings:
34
+ serializedVersion: 2
35
+ filterMode: 1
36
+ aniso: 1
37
+ mipBias: 0
38
+ wrapU: 0
39
+ wrapV: 0
40
+ wrapW: 0
41
+ nPOTScale: 1
42
+ lightmap: 0
43
+ compressionQuality: 50
44
+ spriteMode: 0
45
+ spriteExtrude: 1
46
+ spriteMeshType: 1
47
+ alignment: 0
48
+ spritePivot: {x: 0.5, y: 0.5}
49
+ spritePixelsToUnits: 100
50
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
51
+ spriteGenerateFallbackPhysicsShape: 1
52
+ alphaUsage: 1
53
+ alphaIsTransparency: 1
54
+ spriteTessellationDetail: -1
55
+ textureType: 0
56
+ textureShape: 1
57
+ singleChannelComponent: 0
58
+ flipbookRows: 1
59
+ flipbookColumns: 1
60
+ maxTextureSizeSet: 0
61
+ compressionQualitySet: 0
62
+ textureFormatSet: 0
63
+ ignorePngGamma: 0
64
+ applyGammaDecoding: 0
65
+ platformSettings:
66
+ - serializedVersion: 3
67
+ buildTarget: DefaultTexturePlatform
68
+ maxTextureSize: 2048
69
+ resizeAlgorithm: 0
70
+ textureFormat: -1
71
+ textureCompression: 1
72
+ compressionQuality: 50
73
+ crunchedCompression: 0
74
+ allowsAlphaSplitting: 0
75
+ overridden: 0
76
+ androidETC2FallbackOverride: 0
77
+ forceMaximumCompressionQuality_BC6H_BC7: 0
78
+ - serializedVersion: 3
79
+ buildTarget: Standalone
80
+ maxTextureSize: 2048
81
+ resizeAlgorithm: 0
82
+ textureFormat: -1
83
+ textureCompression: 1
84
+ compressionQuality: 50
85
+ crunchedCompression: 0
86
+ allowsAlphaSplitting: 0
87
+ overridden: 0
88
+ androidETC2FallbackOverride: 0
89
+ forceMaximumCompressionQuality_BC6H_BC7: 0
90
+ - serializedVersion: 3
91
+ buildTarget: iPhone
92
+ maxTextureSize: 2048
93
+ resizeAlgorithm: 0
94
+ textureFormat: -1
95
+ textureCompression: 1
96
+ compressionQuality: 50
97
+ crunchedCompression: 0
98
+ allowsAlphaSplitting: 0
99
+ overridden: 0
100
+ androidETC2FallbackOverride: 0
101
+ forceMaximumCompressionQuality_BC6H_BC7: 0
102
+ - serializedVersion: 3
103
+ buildTarget: WebGL
104
+ maxTextureSize: 2048
105
+ resizeAlgorithm: 0
106
+ textureFormat: -1
107
+ textureCompression: 1
108
+ compressionQuality: 50
109
+ crunchedCompression: 0
110
+ allowsAlphaSplitting: 0
111
+ overridden: 0
112
+ androidETC2FallbackOverride: 0
113
+ forceMaximumCompressionQuality_BC6H_BC7: 0
114
+ - serializedVersion: 3
115
+ buildTarget: Android
116
+ maxTextureSize: 2048
117
+ resizeAlgorithm: 0
118
+ textureFormat: -1
119
+ textureCompression: 1
120
+ compressionQuality: 50
121
+ crunchedCompression: 0
122
+ allowsAlphaSplitting: 0
123
+ overridden: 0
124
+ androidETC2FallbackOverride: 0
125
+ forceMaximumCompressionQuality_BC6H_BC7: 0
126
+ spriteSheet:
127
+ serializedVersion: 2
128
+ sprites: []
129
+ outline: []
130
+ physicsShape: []
131
+ bones: []
132
+ spriteID:
133
+ internalID: 0
134
+ vertices: []
135
+ indices:
136
+ edges: []
137
+ weights: []
138
+ secondaryTextures: []
139
+ spritePackingTag:
140
+ pSDRemoveMatte: 0
141
+ pSDShowRemoveMatteOption: 0
142
+ userData:
143
+ assetBundleName:
144
+ assetBundleVariant:
Binary file
@@ -0,0 +1,144 @@
1
+ fileFormatVersion: 2
2
+ guid: 0b7f2e52983b2114eb2a72ed03a0c107
3
+ TextureImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 11
7
+ mipmaps:
8
+ mipMapMode: 0
9
+ enableMipMap: 1
10
+ sRGBTexture: 1
11
+ linearTexture: 0
12
+ fadeOut: 0
13
+ borderMipMap: 0
14
+ mipMapsPreserveCoverage: 0
15
+ alphaTestReferenceValue: 0.5
16
+ mipMapFadeDistanceStart: 1
17
+ mipMapFadeDistanceEnd: 3
18
+ bumpmap:
19
+ convertToNormalMap: 0
20
+ externalNormalMap: 0
21
+ heightScale: 0.25
22
+ normalMapFilter: 0
23
+ isReadable: 0
24
+ streamingMipmaps: 0
25
+ streamingMipmapsPriority: 0
26
+ vTOnly: 0
27
+ grayScaleToAlpha: 0
28
+ generateCubemap: 6
29
+ cubemapConvolution: 0
30
+ seamlessCubemap: 0
31
+ textureFormat: 1
32
+ maxTextureSize: 2048
33
+ textureSettings:
34
+ serializedVersion: 2
35
+ filterMode: 1
36
+ aniso: 1
37
+ mipBias: 0
38
+ wrapU: 0
39
+ wrapV: 0
40
+ wrapW: 0
41
+ nPOTScale: 1
42
+ lightmap: 0
43
+ compressionQuality: 50
44
+ spriteMode: 0
45
+ spriteExtrude: 1
46
+ spriteMeshType: 1
47
+ alignment: 0
48
+ spritePivot: {x: 0.5, y: 0.5}
49
+ spritePixelsToUnits: 100
50
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
51
+ spriteGenerateFallbackPhysicsShape: 1
52
+ alphaUsage: 1
53
+ alphaIsTransparency: 1
54
+ spriteTessellationDetail: -1
55
+ textureType: 0
56
+ textureShape: 1
57
+ singleChannelComponent: 0
58
+ flipbookRows: 1
59
+ flipbookColumns: 1
60
+ maxTextureSizeSet: 0
61
+ compressionQualitySet: 0
62
+ textureFormatSet: 0
63
+ ignorePngGamma: 0
64
+ applyGammaDecoding: 0
65
+ platformSettings:
66
+ - serializedVersion: 3
67
+ buildTarget: DefaultTexturePlatform
68
+ maxTextureSize: 2048
69
+ resizeAlgorithm: 0
70
+ textureFormat: -1
71
+ textureCompression: 1
72
+ compressionQuality: 50
73
+ crunchedCompression: 0
74
+ allowsAlphaSplitting: 0
75
+ overridden: 0
76
+ androidETC2FallbackOverride: 0
77
+ forceMaximumCompressionQuality_BC6H_BC7: 0
78
+ - serializedVersion: 3
79
+ buildTarget: Standalone
80
+ maxTextureSize: 2048
81
+ resizeAlgorithm: 0
82
+ textureFormat: -1
83
+ textureCompression: 1
84
+ compressionQuality: 50
85
+ crunchedCompression: 0
86
+ allowsAlphaSplitting: 0
87
+ overridden: 0
88
+ androidETC2FallbackOverride: 0
89
+ forceMaximumCompressionQuality_BC6H_BC7: 0
90
+ - serializedVersion: 3
91
+ buildTarget: iPhone
92
+ maxTextureSize: 2048
93
+ resizeAlgorithm: 0
94
+ textureFormat: -1
95
+ textureCompression: 1
96
+ compressionQuality: 50
97
+ crunchedCompression: 0
98
+ allowsAlphaSplitting: 0
99
+ overridden: 0
100
+ androidETC2FallbackOverride: 0
101
+ forceMaximumCompressionQuality_BC6H_BC7: 0
102
+ - serializedVersion: 3
103
+ buildTarget: WebGL
104
+ maxTextureSize: 2048
105
+ resizeAlgorithm: 0
106
+ textureFormat: -1
107
+ textureCompression: 1
108
+ compressionQuality: 50
109
+ crunchedCompression: 0
110
+ allowsAlphaSplitting: 0
111
+ overridden: 0
112
+ androidETC2FallbackOverride: 0
113
+ forceMaximumCompressionQuality_BC6H_BC7: 0
114
+ - serializedVersion: 3
115
+ buildTarget: Android
116
+ maxTextureSize: 2048
117
+ resizeAlgorithm: 0
118
+ textureFormat: -1
119
+ textureCompression: 1
120
+ compressionQuality: 50
121
+ crunchedCompression: 0
122
+ allowsAlphaSplitting: 0
123
+ overridden: 0
124
+ androidETC2FallbackOverride: 0
125
+ forceMaximumCompressionQuality_BC6H_BC7: 0
126
+ spriteSheet:
127
+ serializedVersion: 2
128
+ sprites: []
129
+ outline: []
130
+ physicsShape: []
131
+ bones: []
132
+ spriteID:
133
+ internalID: 0
134
+ vertices: []
135
+ indices:
136
+ edges: []
137
+ weights: []
138
+ secondaryTextures: []
139
+ spritePackingTag:
140
+ pSDRemoveMatte: 0
141
+ pSDShowRemoveMatteOption: 0
142
+ userData:
143
+ assetBundleName:
144
+ assetBundleVariant:
@@ -641,11 +641,48 @@ namespace TyphoonUnitySDK
641
641
  /// </summary>
642
642
  public static string ToUnityRelativePath(string path)
643
643
  {
644
+ if (string.IsNullOrEmpty(path))
645
+ {
646
+ return "";
647
+ }
648
+
644
649
  return Path.GetFullPath(path).Replace("/", "\\").Replace(
645
650
  $"{Path.GetDirectoryName(Application.dataPath)}\\", "")
646
651
  .Replace("\\", "/");
647
652
  }
648
653
 
654
+
655
+ /// <summary>
656
+ /// 反射获取有效的枚举
657
+ /// </summary>
658
+ public static T[] GetValidEnumValues<T>() where T : Enum
659
+ {
660
+ var type = typeof(T);
661
+ var match = new HashSet<string>();
662
+ var names = Enum.GetNames(typeof(T));
663
+ foreach (var element in names)
664
+ {
665
+ var fieldInfo = type.GetField(element);
666
+ // 检查特性是否废弃
667
+ if (fieldInfo.GetCustomAttributes(typeof(ObsoleteAttribute), false).Length > 0)
668
+ {
669
+ continue;
670
+ }
671
+ else
672
+ {
673
+ match.Add(fieldInfo.Name);
674
+ }
675
+ }
676
+
677
+ List<T> result = new List<T>();
678
+ foreach (var value in match)
679
+ {
680
+ result.Add((T)Enum.Parse(typeof(T), value));
681
+ }
682
+
683
+ return result.ToArray();
684
+ }
685
+
649
686
  // /// <summary>
650
687
  // /// 执行批处理
651
688
  // /// </summary>
@@ -13,6 +13,7 @@ namespace TyphoonUnitySDK
13
13
  {
14
14
  //微信小游戏进阶设置
15
15
  private static bool _wxMiniConfigAdvanceFoldout = false;
16
+ private static Vector2 _scrollPrivacyPolicy;
16
17
 
17
18
  public static Dictionary<string, Func<VivoMiniConfig, bool>> OverrideDrawGUIConfig =
18
19
  new Dictionary<string, Func<VivoMiniConfig, bool>>()
@@ -40,8 +41,43 @@ namespace TyphoonUnitySDK
40
41
  { nameof(VivoMiniConfig.VideoEnable), DrawProperty_VideoEnable },
41
42
  { nameof(VivoMiniConfig.VideoPosId), DrawProperty_VideoPosId },
42
43
  { nameof(VivoMiniConfig.VideoResetIntersCool), DrawProperty_VideoResetIntersCool },
44
+ { nameof(VivoMiniConfig.PrivacyPolicyFile), DrawProperty_PrivacyPolicy },
45
+ { nameof(VivoMiniConfig.AgeLevel), DrawProperty_AgeLevel },
43
46
  };
44
47
 
48
+ private static bool DrawProperty_AgeLevel(VivoMiniConfig arg)
49
+ {
50
+ GUILayout.Space(3);
51
+ GUILayout.BeginHorizontal();
52
+ GUILayout.Label("适龄提醒", GUILayout.Width(146));
53
+ if (GUILayout.Button(arg.AgeLevel.ToString(), "PopUp"))
54
+ {
55
+ var menu = new GenericMenu();
56
+ var options = UniEditor.GetValidEnumValues<AgeLevel>();
57
+ foreach (var option in options)
58
+ {
59
+ menu.AddItem(new GUIContent(option.ToString()), false, () => { arg.AgeLevel = option; });
60
+ }
61
+
62
+ menu.ShowAsContext();
63
+ }
64
+
65
+ GUILayout.EndHorizontal();
66
+ return true;
67
+ }
68
+
69
+ private static bool DrawProperty_PrivacyPolicy(VivoMiniConfig arg)
70
+ {
71
+ GUILayout.Space(10);
72
+ GUILayout.Label("隐私政策", Styles.rbold_title);
73
+ GUILayout.BeginHorizontal();
74
+ GUILayout.Label("文案", GUILayout.Width(146));
75
+ arg.PrivacyPolicyFile =
76
+ EditorGUILayout.ObjectField(arg.PrivacyPolicyFile, typeof(TextAsset), false) as TextAsset;
77
+ GUILayout.EndHorizontal();
78
+ return true;
79
+ }
80
+
45
81
  private static bool DrawProperty_VideoResetIntersCool(VivoMiniConfig arg)
46
82
  {
47
83
  if (!arg.VideoEnable)
@@ -160,7 +196,10 @@ namespace TyphoonUnitySDK
160
196
  if (GUILayout.Button("选择", GUILayout.Width(60)))
161
197
  {
162
198
  var file = EditorUtility.OpenFilePanel("请选择certificate.pem", Application.dataPath, "pem");
163
- arg.CertificatePem = UniEditor.ToUnityRelativePath(file);
199
+ if (!string.IsNullOrEmpty(file))
200
+ {
201
+ arg.CertificatePem = UniEditor.ToUnityRelativePath(file);
202
+ }
164
203
  }
165
204
 
166
205
  GUILayout.EndHorizontal();
@@ -192,8 +231,11 @@ namespace TyphoonUnitySDK
192
231
  if (GUILayout.Button("选择", GUILayout.Width(60)))
193
232
  {
194
233
  var file = EditorUtility.OpenFilePanel("请选择private.pem", Application.dataPath, "pem");
195
- //尝试转成相对路径
196
- arg.PrivatePem = UniEditor.ToUnityRelativePath(file);
234
+ if (!string.IsNullOrEmpty(file))
235
+ {
236
+ //尝试转成相对路径
237
+ arg.PrivatePem = UniEditor.ToUnityRelativePath(file);
238
+ }
197
239
  }
198
240
 
199
241
  GUILayout.EndHorizontal();
@@ -274,7 +316,7 @@ namespace TyphoonUnitySDK
274
316
  private static bool DrawProperty_LoadBackground(VivoMiniConfig arg)
275
317
  {
276
318
  arg.LoadBackground =
277
- (Texture)EditorGUILayout.ObjectField("加载背景(可选,默认纯黑)", arg.LoadBackground, typeof(Texture), false);
319
+ (Texture)EditorGUILayout.ObjectField("加载背景(推荐512*1024)", arg.LoadBackground, typeof(Texture), false);
278
320
  return true;
279
321
  }
280
322
 
@@ -421,6 +463,10 @@ namespace TyphoonUnitySDK
421
463
  public int VideoResetIntersCool = 40; //播放视频广告后x秒后不弹出插页广告,-1为不控制[number]
422
464
  public string VideoPosId = ""; //插屏广告位ID[string]
423
465
 
466
+ public TextAsset PrivacyPolicyFile; //隐私协议
467
+
468
+ public AgeLevel AgeLevel = AgeLevel.Age8; //适龄提醒
469
+
424
470
  public string GetFinalCDN()
425
471
  {
426
472
  var result = CDN.Replace("[版本号]", VersionCode.ToString());
Binary file
@@ -0,0 +1,33 @@
1
+ fileFormatVersion: 2
2
+ guid: 5809016988dc98846879befde3bf92bf
3
+ PluginImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ iconMap: {}
7
+ executionOrder: {}
8
+ defineConstraints: []
9
+ isPreloaded: 0
10
+ isOverridable: 0
11
+ isExplicitlyReferenced: 0
12
+ validateReferences: 1
13
+ platformData:
14
+ - first:
15
+ Any:
16
+ second:
17
+ enabled: 0
18
+ settings: {}
19
+ - first:
20
+ Editor: Editor
21
+ second:
22
+ enabled: 1
23
+ settings:
24
+ DefaultValueInitialized: true
25
+ - first:
26
+ Windows Store Apps: WindowsStoreApps
27
+ second:
28
+ enabled: 0
29
+ settings:
30
+ CPU: AnyCPU
31
+ userData:
32
+ assetBundleName:
33
+ assetBundleVariant:
@@ -0,0 +1,12 @@
1
+ namespace TyphoonUnitySDK
2
+ {
3
+ /// <summary>
4
+ /// 适龄提醒
5
+ /// </summary>
6
+ public enum AgeLevel
7
+ {
8
+ Age8 = 8,
9
+ Age12 = 12,
10
+ Age16 = 16,
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 5308de6df69c28345be2efb8fa7ae34d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.36","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.37","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}