com.typhoon.unitysdk 1.0.36 → 1.0.38
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.
- package/Editor/ApplyTool.cs +15 -0
- package/Editor/PublishSetting.cs +3 -0
- package/Editor/PublishSettingGUIDrawer.cs +26 -0
- package/Editor/Texture/age_12.png +0 -0
- package/Editor/Texture/age_12.png.meta +144 -0
- package/Editor/Texture/age_16.png +0 -0
- package/Editor/Texture/age_16.png.meta +144 -0
- package/Editor/Texture/age_8.png +0 -0
- package/Editor/Texture/age_8.png.meta +144 -0
- package/Editor/ToolBox/CompressTextureTool/XCompressTool.cs +2844 -0
- package/Editor/ToolBox/CompressTextureTool/XCompressTool.cs.meta +11 -0
- package/Editor/ToolBox/CompressTextureTool.meta +8 -0
- package/Editor/ToolBox.meta +8 -0
- package/Editor/UniEditor.cs +37 -0
- package/Editor/VivoMiniConfig.cs +50 -4
- package/Editor/dll/PNGCompressor.dll +0 -0
- package/Editor/dll/PNGCompressor.dll.meta +33 -0
- package/Runtime/AgeLevel.cs +12 -0
- package/Runtime/AgeLevel.cs.meta +11 -0
- package/Sources~/Package/VivoMini.unitypackage +0 -0
- package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
- package/package.json +1 -1
package/Editor/UniEditor.cs
CHANGED
|
@@ -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>
|
package/Editor/VivoMiniConfig.cs
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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("加载背景(
|
|
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:
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.
|
|
1
|
+
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.38","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"}}
|