com.typhoon.unitysdk 1.0.94 → 1.0.95

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.
@@ -1,6 +1,8 @@
1
1
  using System;
2
2
  using System.Collections.Generic;
3
3
  using System.IO;
4
+ using System.Text.RegularExpressions;
5
+ using System.Threading.Tasks;
4
6
  using UnityEditor;
5
7
  using UnityEngine;
6
8
 
@@ -38,11 +40,26 @@ namespace TyphoonUnitySDK
38
40
  /// </summary>
39
41
  public static void SaveAllChannelConfig()
40
42
  {
43
+ // var classTypes = UniEditor.GetSubClassTypes(typeof(ISaveConfigPipeline));
44
+ // foreach (var classType in classTypes)
45
+ // {
46
+ // var guids = AssetDatabase.FindAssets($"t:{classType.FullName}", new[] { "Assets" });
47
+ // foreach (var guid in guids)
48
+ // {
49
+ // var path = AssetDatabase.GUIDToAssetPath(guid);
50
+ // if (!string.IsNullOrEmpty(path))
51
+ // {
52
+ // var asset = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(path);
53
+ // (asset as ISaveConfigPipeline)?.SaveConfig();
54
+ // }
55
+ // }
56
+ // }
41
57
  VivoMiniConfig.Default.Save();
42
58
  WxMiniConfig.Default.Save();
43
59
  DouyinConfig.Default.Save();
44
60
  VariablePreset.Default.Save();
45
61
  OppoMiniConfig.Default.Save();
62
+ ChinaAndroidConfig.Default.Save();
46
63
  }
47
64
 
48
65
  /// <summary>
@@ -0,0 +1,128 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.IO;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace TyphoonUnitySDK
8
+ {
9
+ public static class ChinaAndroidConfigGUIDrawer
10
+ {
11
+ public static Dictionary<string, Func<ChinaAndroidConfig, bool>> OverrideDrawGUIFunc =
12
+ new Dictionary<string, Func<ChinaAndroidConfig, bool>>()
13
+ {
14
+ { "m_Script", DrawProperty_m_Script },
15
+ { $"{nameof(Orientation)}", DrawProperty_Orientation },
16
+ };
17
+
18
+ private static bool DrawProperty_Orientation(ChinaAndroidConfig arg)
19
+ {
20
+ var txt = arg.Orientation == ChinaAndroidConfig.ScreenOrientation.Portrait ? "竖屏" : "横屏";
21
+ GUILayout.Label("横竖屏模式", Styles.BoldLabel);
22
+ if (GUILayout.Button(txt, "PopUp"))
23
+ {
24
+ var menu = new GenericMenu();
25
+ menu.AddItem(new GUIContent("竖屏"), arg.Orientation == ChinaAndroidConfig.ScreenOrientation.Portrait,
26
+ () =>
27
+ {
28
+ arg.Orientation = ChinaAndroidConfig.ScreenOrientation.Portrait;
29
+ arg.Save();
30
+ });
31
+ menu.AddItem(new GUIContent("横屏"), arg.Orientation == ChinaAndroidConfig.ScreenOrientation.Landscape,
32
+ () =>
33
+ {
34
+ arg.Orientation = ChinaAndroidConfig.ScreenOrientation.Landscape;
35
+ arg.Save();
36
+ });
37
+ menu.ShowAsContext();
38
+ }
39
+
40
+ return true;
41
+ }
42
+
43
+ private static bool DrawProperty_m_Script(ChinaAndroidConfig arg)
44
+ {
45
+ var tmpEnable = GUI.enabled;
46
+ GUI.enabled = true;
47
+ GUILayout.Space(6);
48
+ GUIDrawer.DrawKeynotes("①需要Unity 2019.3+ 或以上,即新版 android 目录结构");
49
+ GUIDrawer.DrawKeynotes("②剔除第三方SDK,避免与渠道冲突或不兼容");
50
+ GUILayout.Space(6);
51
+ GUI.enabled = tmpEnable;
52
+ return true;
53
+ }
54
+
55
+
56
+ /*绘制GUI*/
57
+ public static void DrawGUI()
58
+ {
59
+ var config = ChinaAndroidConfig.Default;
60
+ GUIDrawer.DrawProperty(config, (property) =>
61
+ {
62
+ if (OverrideDrawGUIFunc.TryGetValue(property, out var match))
63
+ {
64
+ return match.Invoke(config);
65
+ }
66
+
67
+ return false;
68
+ });
69
+ }
70
+ }
71
+
72
+ public class ChinaAndroidConfig : ScriptableObject
73
+ {
74
+ private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/ChinaAndroidConfig.asset";
75
+
76
+ private static ChinaAndroidConfig _instance = null;
77
+
78
+ public static ChinaAndroidConfig Default
79
+ {
80
+ get
81
+ {
82
+ if (_instance == null)
83
+ {
84
+ _instance = AssetDatabase.LoadAssetAtPath<ChinaAndroidConfig>(ConfigPath);
85
+ }
86
+
87
+ if (_instance == null)
88
+ {
89
+ _instance = CreateInstance<ChinaAndroidConfig>();
90
+ var folder = Path.GetDirectoryName(ConfigPath);
91
+ if (!Directory.Exists(folder))
92
+ {
93
+ Directory.CreateDirectory(folder);
94
+ AssetDatabase.Refresh();
95
+ }
96
+
97
+ AssetDatabase.CreateAsset(_instance, ConfigPath);
98
+ }
99
+
100
+ return _instance;
101
+ }
102
+ }
103
+
104
+ /// <summary>
105
+ /// 横竖屏模式
106
+ /// </summary>
107
+ public enum ScreenOrientation
108
+ {
109
+ Portrait,
110
+ Landscape,
111
+ }
112
+
113
+ [Header("横竖屏模式")] public ScreenOrientation Orientation = ScreenOrientation.Portrait;
114
+
115
+ [LabelOverride("保留导出工程")] public bool KeepProj = false;
116
+
117
+ public void Save()
118
+ {
119
+ EditorUtility.SetDirty(this);
120
+ AssetDatabase.SaveAssets();
121
+ }
122
+
123
+ public void SaveConfig()
124
+ {
125
+ Save();
126
+ }
127
+ }
128
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0926d67246403c84087b96d1964271b8
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -3,7 +3,6 @@ using System.Collections.Generic;
3
3
  using System.IO;
4
4
  using UnityEditor;
5
5
  using UnityEngine;
6
- using UnityEngine.Serialization;
7
6
 
8
7
  namespace TyphoonUnitySDK
9
8
  {
@@ -95,7 +94,7 @@ namespace TyphoonUnitySDK
95
94
  /// <summary>
96
95
  /// 抖音小游戏配置
97
96
  /// </summary>
98
- public class DouyinConfig : ScriptableObject
97
+ public class DouyinConfig : ScriptableObject, ISaveConfigPipeline
99
98
  {
100
99
  private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/DouyinConfig.asset";
101
100
  public static string INIPath = ".typhoon/unitysdk/douyin.ini";
@@ -139,5 +138,10 @@ namespace TyphoonUnitySDK
139
138
  EditorUtility.SetDirty(this);
140
139
  AssetDatabase.SaveAssets();
141
140
  }
141
+
142
+ public void SaveConfig()
143
+ {
144
+ Save();
145
+ }
142
146
  }
143
147
  }
@@ -20,7 +20,7 @@ namespace TyphoonUnitySDK
20
20
  {
21
21
  // "Assets/Plugins/Android/libs/sdk_plug-release.aar",
22
22
  // "Assets/Plugins/Android/libs/unity_app-release.aar",
23
- // "Assets/Plugins/Android/libs/unity_launcher-release.aar",
23
+ "Assets/Plugins/Android/libs/lib-union-sdk.aar",
24
24
  "Assets/Plugins/Android/AndroidManifest.xml",
25
25
  "Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid",
26
26
  };
@@ -0,0 +1,14 @@
1
+ using System.Collections;
2
+ using System.Collections.Generic;
3
+ using UnityEngine;
4
+
5
+ namespace TyphoonUnitySDK
6
+ {
7
+ /// <summary>
8
+ /// 配置保存管线
9
+ /// </summary>
10
+ public interface ISaveConfigPipeline
11
+ {
12
+ void SaveConfig();
13
+ }
14
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 6be6fd7dd9cac534cb2deb7cd2fb5f15
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -470,7 +470,7 @@ namespace TyphoonUnitySDK
470
470
  /// <summary>
471
471
  /// oppo mini 参数
472
472
  /// </summary>
473
- public class OppoMiniConfig : ScriptableObject
473
+ public class OppoMiniConfig : ScriptableObject, ISaveConfigPipeline
474
474
  {
475
475
  private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/OppoMiniConfig.asset";
476
476
 
@@ -539,5 +539,10 @@ namespace TyphoonUnitySDK
539
539
  EditorUtility.SetDirty(this);
540
540
  AssetDatabase.SaveAssets();
541
541
  }
542
+
543
+ public void SaveConfig()
544
+ {
545
+ Save();
546
+ }
542
547
  }
543
548
  }
@@ -1,7 +1,3 @@
1
- using System.Collections;
2
- using System.Collections.Generic;
3
- using UnityEngine;
4
-
5
1
  namespace TyphoonUnitySDK
6
2
  {
7
3
  /// <summary>
@@ -9,6 +5,11 @@ namespace TyphoonUnitySDK
9
5
  /// </summary>
10
6
  public class PublishResult
11
7
  {
8
+ /// <summary>
9
+ /// 是否成功
10
+ /// </summary>
11
+ public bool IsSuccess = false;
12
+
12
13
  /// <summary>
13
14
  /// 发布设置
14
15
  /// </summary>
@@ -19,6 +20,12 @@ namespace TyphoonUnitySDK
19
20
  /// </summary>
20
21
  public string AndroidProj;
21
22
 
23
+ /// <summary>
24
+ /// 导出的AndroidAPK
25
+ /// </summary>
26
+ public string AndroidApk;
27
+
28
+
22
29
  /// <summary>
23
30
  /// 导出的微信工程
24
31
  /// </summary>
@@ -105,6 +105,10 @@ public AndroidSdkVersions MinApiVersion = AndroidSdkVersions.AndroidApiLevel22;
105
105
 
106
106
  /*oppo小游戏拓展配置*/
107
107
  public bool OppoMiniGUIFoldout = true;
108
+
109
+ //国内安卓拓展配置
110
+ public bool ChinaAndroidGUIFoldout = true;
111
+
108
112
 
109
113
 
110
114
  //使用配置
@@ -54,8 +54,27 @@ namespace TyphoonUnitySDK
54
54
  { nameof(PublishSetting.DouyinGUIFoldout), DrawProperty_DouyinGUIFoldout },
55
55
  { nameof(PublishSetting.VivoMiniGUIFoldout), DrawProperty_VivoMiniGUIFoldout },
56
56
  { nameof(PublishSetting.OppoMiniGUIFoldout), DrawProperty_OppoMiniGUIFoldout },
57
+ { nameof(PublishSetting.ChinaAndroidGUIFoldout), DrawProperty_ChinaAndroidGUIFoldout },
57
58
  };
58
59
 
60
+ private static bool DrawProperty_ChinaAndroidGUIFoldout(PublishSetting arg)
61
+ {
62
+ if (arg.Channel != AppChannel.ChinaAndroid)
63
+ {
64
+ return true;
65
+ }
66
+
67
+ GUILayout.Space(10);
68
+ arg.ChinaAndroidGUIFoldout =
69
+ GUIDrawer.DrawFoldout("国内Android", arg.ChinaAndroidGUIFoldout, GUILayout.Height(26));
70
+ if (arg.ChinaAndroidGUIFoldout)
71
+ {
72
+ ChinaAndroidConfigGUIDrawer.DrawGUI();
73
+ }
74
+
75
+ return true;
76
+ }
77
+
59
78
  private static bool DrawProperty_WebglDataCaching(PublishSetting arg)
60
79
  {
61
80
  if (arg.BuildTarget != BuildTarget.WebGL)
@@ -10,7 +10,7 @@ namespace TyphoonUnitySDK
10
10
  /// 变量预设
11
11
  /// 用于自定义工具内的变量名
12
12
  /// </summary>
13
- public class VariablePreset : ScriptableObject
13
+ public class VariablePreset : ScriptableObject, ISaveConfigPipeline
14
14
  {
15
15
  private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/VariablePreset.asset";
16
16
 
@@ -148,7 +148,6 @@ namespace TyphoonUnitySDK
148
148
  {
149
149
  Presets[index].VariableValue = value;
150
150
  }
151
-
152
151
  }
153
152
 
154
153
  public void Save()
@@ -156,5 +155,10 @@ namespace TyphoonUnitySDK
156
155
  EditorUtility.SetDirty(this);
157
156
  AssetDatabase.SaveAssets();
158
157
  }
158
+
159
+ public void SaveConfig()
160
+ {
161
+ Save();
162
+ }
159
163
  }
160
164
  }
@@ -429,7 +429,7 @@ namespace TyphoonUnitySDK
429
429
  /// <summary>
430
430
  /// vivo mini 参数
431
431
  /// </summary>
432
- public class VivoMiniConfig : ScriptableObject
432
+ public class VivoMiniConfig : ScriptableObject, ISaveConfigPipeline
433
433
  {
434
434
  private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/VivoMiniConfig.asset";
435
435
 
@@ -500,5 +500,10 @@ namespace TyphoonUnitySDK
500
500
  EditorUtility.SetDirty(this);
501
501
  AssetDatabase.SaveAssets();
502
502
  }
503
+
504
+ public void SaveConfig()
505
+ {
506
+ Save();
507
+ }
503
508
  }
504
509
  }
@@ -206,7 +206,7 @@ namespace TyphoonUnitySDK
206
206
  /// <summary>
207
207
  /// 微信小游戏配置
208
208
  /// </summary>
209
- public class WxMiniConfig : ScriptableObject
209
+ public class WxMiniConfig : ScriptableObject, ISaveConfigPipeline
210
210
  {
211
211
  private static string ConfigPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/WxMiniConfig.asset";
212
212
 
@@ -273,5 +273,10 @@ namespace TyphoonUnitySDK
273
273
  EditorUtility.SetDirty(this);
274
274
  AssetDatabase.SaveAssets();
275
275
  }
276
+
277
+ public void SaveConfig()
278
+ {
279
+ Save();
280
+ }
276
281
  }
277
282
  }
@@ -34,21 +34,21 @@ namespace TyphoonUnitySDK
34
34
  SessionItem.Invoke(sessionId, data);
35
35
  }
36
36
 
37
- public void Update()
38
- {
39
- switch (AppConfig.Channel)
40
- {
41
- case AppChannel.ChinaAndroid:
42
- if (Input.GetKeyDown(KeyCode.Escape))
43
- {
44
- if (SdkLite.Instance.IsSupportQuitWithKeep())
45
- {
46
- SdkLite.Instance.QuitWithKeep();
47
- }
48
- }
49
-
50
- break;
51
- }
52
- }
37
+ // public void Update()
38
+ // {
39
+ // switch (AppConfig.Channel)
40
+ // {
41
+ // case AppChannel.ChinaAndroid:
42
+ // if (Input.GetKeyDown(KeyCode.Escape))
43
+ // {
44
+ // if (SdkLite.Instance.IsSupportQuitWithKeep())
45
+ // {
46
+ // SdkLite.Instance.QuitWithKeep();
47
+ // }
48
+ // }
49
+ //
50
+ // break;
51
+ // }
52
+ // }
53
53
  }
54
54
  }
@@ -1,3 +1,4 @@
1
+ Assets/Plugins/Android/libs/lib-union-sdk.aar
1
2
  Assets/Plugins/Android/AndroidManifest.xml
2
3
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid
3
4
  Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.94","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"}],"version_log":"## [1.0.94] - 2024-01-25\r\n\r\n### 新增\n* 更新vivo app sdk\r\n\r\n","major_flag":false,"write_time_stamp":1706194439000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.95","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"}],"version_log":"## [1.0.94] - 2024-01-25\r\n\r\n### 新增\n* 更新vivo app sdk\r\n\r\n","major_flag":false,"write_time_stamp":1706850595000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}