com.typhoon.unitysdk 1.0.24 → 1.0.25

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.
@@ -46,19 +46,19 @@ namespace TyphoonUnitySDK
46
46
  case BuildTarget.Android:
47
47
  {
48
48
  ModifyAndroidPlayerSetting(setting);
49
- UniEditor.LogInfo("//TODO//根据发布模式导入更换资源包");
49
+ Debug.Log($"<color=#3ac9f3>根据发布模式导入更换资源包</color>");
50
50
  }
51
51
  break;
52
52
  case BuildTarget.iOS:
53
53
  {
54
54
  ModifyIOSSetting(setting);
55
- UniEditor.LogInfo("//TODO//根据发布模式导入更换资源包");
55
+ Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
56
56
  }
57
57
  break;
58
58
  case BuildTarget.WebGL:
59
59
  {
60
60
  ModifyWebglSetting(setting);
61
- UniEditor.LogInfo("//TODO//根据发布模式导入更换资源包");
61
+ Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
62
62
  }
63
63
  break;
64
64
  default:
@@ -142,7 +142,7 @@ namespace TyphoonUnitySDK
142
142
  AddressableSupport.ModifyAAProfileAndVariables(setting);
143
143
  //写入App config
144
144
  WriteAppConfig(setting);
145
- UniEditor.LogInfo("//TODO//导入资源包...");
145
+ Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
146
146
  }
147
147
 
148
148
  /// <summary>
@@ -157,7 +157,7 @@ namespace TyphoonUnitySDK
157
157
  AddressableSupport.ModifyAAProfileAndVariables(setting);
158
158
  //写入App config
159
159
  WriteAppConfig(setting);
160
- UniEditor.LogInfo("//TODO//导入资源包...");
160
+ Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
161
161
  }
162
162
 
163
163
  /// <summary>
@@ -196,7 +196,7 @@ namespace TyphoonUnitySDK
196
196
  AddressableSupport.ModifyAAProfileAndVariables(setting);
197
197
  //写入App config
198
198
  WriteAppConfig(setting);
199
- UniEditor.LogInfo("//TODO//导入资源包...");
199
+ Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
200
200
  }
201
201
 
202
202
  /// <summary>
@@ -255,6 +255,27 @@ namespace TyphoonUnitySDK
255
255
  }
256
256
 
257
257
 
258
+ [MenuItem("TyphoonSDK/开发者/导出-Toast.unitypackage")]
259
+ public static void ExportToastModule()
260
+ {
261
+ var manifest = new List<string>()
262
+ {
263
+ "Assets/Typhoon_Gen/TyphoonSDK/Toast",
264
+ };
265
+ if (!MakeSureExport(manifest))
266
+ {
267
+ return;
268
+ }
269
+
270
+ if (!CheckMissFiles(manifest))
271
+ {
272
+ return;
273
+ }
274
+
275
+ ExportUnityPackage(manifest, UniEditor.PackagePath_Toast, out var detail);
276
+ }
277
+
278
+
258
279
  /// <summary>
259
280
  /// 导出UnityPackage
260
281
  /// </summary>
@@ -27,20 +27,17 @@ namespace TyphoonUnitySDK
27
27
  _instance = CreateInstance<Preferences>();
28
28
  UniEditor.CreateDirIfNotExist(Path.GetDirectoryName(AssetPath));
29
29
  AssetDatabase.CreateAsset(_instance, AssetPath);
30
- UniEditor.LogInfo($"生成:{AssetPath}");
30
+ Debug.Log($"<color=#3ac9f3>生成:{AssetPath}</color>");
31
31
  }
32
32
 
33
33
  return _instance;
34
34
  }
35
35
  }
36
36
 
37
- [Header("检查拓展Addressable开关")]
38
- /*检查Addressable Plug安装*/
39
- public bool CheckInstallAddressablePlug = true;
40
-
37
+
38
+ public bool CheckAddressableSupport = true;
39
+
40
+
41
41
  [Header("gradle目录")] public string GradlePath = string.Empty;
42
-
43
-
44
-
45
42
  }
46
43
  }
@@ -3,7 +3,6 @@ using System.Collections.Generic;
3
3
  using System.IO;
4
4
  using UnityEditor;
5
5
  using UnityEngine;
6
- using Object = UnityEngine.Object;
7
6
 
8
7
  namespace TyphoonUnitySDK
9
8
  {
@@ -58,21 +57,8 @@ namespace TyphoonUnitySDK
58
57
  area.x += 4;
59
58
  area.height = rect.yMax - area.yMin - 4;
60
59
  GUILayout.BeginArea(area);
61
-
62
60
  _scroll = GUILayout.BeginScrollView(_scroll);
63
- _preferenceFoldout = GUIDrawer.DrawFoldout("偏好设置", _preferenceFoldout, GUILayout.Height(26));
64
- if (_preferenceFoldout)
65
- {
66
- DrawPreferencesPropertyGUI(Preferences.Default);
67
- }
68
-
69
- GUILayout.Space(10);
70
- _wxMiniConfigFoldout = GUIDrawer.DrawFoldout("微信小游戏", _wxMiniConfigFoldout, GUILayout.Height(26));
71
- if (_wxMiniConfigFoldout)
72
- {
73
- WxMiniConfigGUIDrawer.DrawWxMiniConfig();
74
- }
75
-
61
+ DrawPreferencesPropertyGUI(Preferences.Default);
76
62
  GUILayout.EndScrollView();
77
63
  GUILayout.EndArea();
78
64
  Repaint();
@@ -84,11 +70,29 @@ namespace TyphoonUnitySDK
84
70
  public static Dictionary<string, Func<Preferences, bool>> OverrideDrawGUIPreferences =
85
71
  new Dictionary<string, Func<Preferences, bool>>()
86
72
  {
87
- { "m_Script", (s) => true },
88
- { nameof(Preferences.CheckInstallAddressablePlug), DrawProperty_CheckInstallAddressablePlug },
73
+ { "m_Script", DrawProperty_mScript },
74
+ { nameof(Preferences.CheckAddressableSupport), DrawProperty_CheckAddressableSupport },
89
75
  { nameof(Preferences.GradlePath), DrawProperty_GradlePath },
90
76
  };
91
77
 
78
+ private static bool DrawProperty_CheckAddressableSupport(Preferences arg)
79
+ {
80
+ GUILayout.Space(10);
81
+ Preferences.Default.CheckAddressableSupport =
82
+ GUILayout.Toggle(Preferences.Default.CheckAddressableSupport, "检查Addressable支持");
83
+ return true;
84
+ }
85
+
86
+ private static bool DrawProperty_mScript(Preferences arg)
87
+ {
88
+ var temEnable = GUI.enabled;
89
+ GUI.enabled = true;
90
+ GUIDrawer.DrawKeynotes("使用须知:");
91
+ GUIDrawer.DrawKeynotes("①工具对Addressable有支持,从菜单:'TyphoonSDK/安装拓展...' 中导入");
92
+ GUI.enabled = temEnable;
93
+ return true;
94
+ }
95
+
92
96
 
93
97
  /*绘制GUI*/
94
98
  public static void DrawPreferencesPropertyGUI(Preferences preferences)
@@ -104,16 +108,9 @@ namespace TyphoonUnitySDK
104
108
  });
105
109
  }
106
110
 
107
- private static bool DrawProperty_CheckInstallAddressablePlug(Preferences arg)
108
- {
109
- arg.CheckInstallAddressablePlug =
110
- GUILayout.Toggle(arg.CheckInstallAddressablePlug, "自动检查Addressabled Supoort");
111
- return true;
112
- }
113
-
114
-
115
111
  private static bool DrawProperty_GradlePath(Preferences preferences)
116
112
  {
113
+ GUILayout.Space(5);
117
114
  if (!UniEditor.GradleIsMatch())
118
115
  {
119
116
  GUILayout.BeginHorizontal();
@@ -13,9 +13,11 @@ namespace TyphoonUnitySDK
13
13
  public string GameName;
14
14
  public Texture Icon;
15
15
  public string PackageName;
16
+ public int TargetSdkVersion = 32;
16
17
  public string AppId;
17
18
  public string PrivacyPolicyYNoteUrl;
18
19
 
20
+
19
21
  [Header("签名相关")] public string KeystoreName;
20
22
  public string KeystorePassword;
21
23
  public string KeyAliasName;
@@ -36,6 +38,7 @@ namespace TyphoonUnitySDK
36
38
  public int VersionCode = 1000000;
37
39
  private static string PATH = "Assets/Editor/PublishVivoBatSetting.asset";
38
40
 
41
+
39
42
  public static PublishVivoBatSetting _default = null;
40
43
 
41
44
  public static PublishVivoBatSetting Default
@@ -219,7 +219,7 @@ android {{
219
219
 
220
220
  defaultConfig {{
221
221
  minSdkVersion 21
222
- targetSdkVersion 32
222
+ targetSdkVersion {Setting.TargetSdkVersion}
223
223
  versionCode {Setting.VersionCode}
224
224
  versionName '{Setting.Version}'
225
225
  applicationId '{Setting.PackageName}'
@@ -36,7 +36,7 @@ namespace TyphoonUnitySDK
36
36
  }
37
37
 
38
38
 
39
- protected void OnGUI()
39
+ protected void OnGUI()
40
40
  {
41
41
  var rect = new Rect(0, 0, position.width, position.height);
42
42
  var area = rect;
@@ -51,7 +51,7 @@ namespace TyphoonUnitySDK
51
51
  rectSave.x -= 4;
52
52
  GUILayout.Space(36);
53
53
  Editor.OnInspectorGUI();
54
- if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save), Styles.rbutton_bold))
54
+ if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save)))
55
55
  {
56
56
  EditorUtility.SetDirty(PublishVivoBatSetting.Default);
57
57
  AssetDatabase.SaveAssets();
@@ -85,6 +85,9 @@ namespace TyphoonUnitySDK
85
85
  }
86
86
  }
87
87
  }
88
+
89
+ //检查一些事情
90
+ UniEditor.CheckSomethingsOnPublishWindowShow();
88
91
  }
89
92
 
90
93
  protected void OnGUI()
@@ -348,21 +351,21 @@ namespace TyphoonUnitySDK
348
351
 
349
352
  if (clickApply)
350
353
  {
351
- UniEditor.LogInfo($"应用...{_select}");
354
+ Debug.Log($"<color=#3ac9f3>应用...{_select}</color>");
352
355
  _select.Apply();
353
- UniEditor.LogInfo($"应用完毕");
356
+ Debug.Log($"<color=#3ac9f3>应用完毕</color>");
354
357
  }
355
358
 
356
359
  if (clickBuildAA)
357
360
  {
358
- UniEditor.LogInfo("构建AA...");
361
+ Debug.Log($"<color=#3ac9f3>构建AA...</color>");
359
362
  AddressableSupport.BuildAASource(_select);
360
- UniEditor.LogInfo("构建AA结束");
363
+ Debug.Log($"<color=#3ac9f3>构建AA结束</color>");
361
364
  }
362
365
 
363
366
  if (clickPublish)
364
367
  {
365
- UniEditor.LogInfo("//TODO//点击了发布");
368
+ Debug.Log($"<color=#3ac9f3>发布...</color>");
366
369
  _select.Publish();
367
370
  }
368
371
 
@@ -5,7 +5,6 @@ using System.Linq;
5
5
  using System.Text;
6
6
  using UnityEditor;
7
7
  using UnityEngine;
8
- using Object = UnityEngine.Object;
9
8
 
10
9
  namespace TyphoonUnitySDK
11
10
  {
@@ -40,6 +39,12 @@ namespace TyphoonUnitySDK
40
39
  public static string PackagePath_Douyin = $"{PathRoot}/Sources~/Package/Douyin.unitypackage";
41
40
 
42
41
 
42
+ /// <summary>
43
+ /// Toast模块
44
+ /// </summary>
45
+ public static string PackagePath_Toast = $"{PathRoot}/Sources~/Package/Toast.unitypackage";
46
+
47
+
43
48
  /// <summary>
44
49
  /// 开启Addressable模块支持
45
50
  /// </summary>
@@ -84,17 +89,17 @@ namespace TyphoonUnitySDK
84
89
  /// </summary>
85
90
  public static void ImportPackage(string path, bool interactive = true)
86
91
  {
87
- LogInfo($"导入----{path}");
92
+ Debug.Log($"<color=#3ac9f3>导入----{path}</color>");
88
93
  AssetDatabase.ImportPackage(path, interactive);
89
94
  }
90
95
 
91
- /// <summary>
92
- /// 日志输出
93
- /// </summary>
94
- public static void LogInfo(string content)
95
- {
96
- Debug.Log($"<color=#3ac9f3>{content}</color>");
97
- }
96
+ // /// <summary>
97
+ // /// 日志输出
98
+ // /// </summary>
99
+ // public static void LogInfo(string content)
100
+ // {
101
+ // Debug.Log($"<color=#3ac9f3>{content}</color>");
102
+ // }
98
103
 
99
104
  /// <summary>
100
105
  /// 清理宏定义
@@ -230,7 +235,6 @@ namespace TyphoonUnitySDK
230
235
  return result;
231
236
  }
232
237
 
233
-
234
238
  /// <summary>
235
239
  /// 是否安装了Addressable
236
240
  /// </summary>
@@ -251,18 +255,19 @@ namespace TyphoonUnitySDK
251
255
  }
252
256
 
253
257
 
254
- [MenuItem("TyphoonSDK/安装/Addressable 支持", priority = 100)]
258
+ [MenuItem("TyphoonSDK/安装拓展/Addressable 支持", priority = 100)]
255
259
  public static void InstallAddressableSupport()
256
260
  {
257
261
  AppendScriptingDefineSymbol(DEFINE_TYPHOON_ADDRESSABLE_NAME);
258
262
  AssetDatabase.Refresh();
259
263
  AssetDatabase.SaveAssets();
264
+ Debug.Log("Addressable 支持,安装成功!");
260
265
  }
261
266
 
262
- [MenuItem("TyphoonSDK/安装/Addressable 支持", true)]
267
+ [MenuItem("TyphoonSDK/安装拓展/Addressable 支持", true)]
263
268
  public static bool InstallAddressableSupportValid()
264
269
  {
265
- return HasAddressable();
270
+ return HasAddressable() && !HasAddressableSupport();
266
271
  }
267
272
 
268
273
  [MenuItem("TyphoonSDK/卸载/Addressable 支持", priority = 100)]
@@ -273,6 +278,7 @@ namespace TyphoonUnitySDK
273
278
  ClearScriptingDefineSymbol(DEFINE_TYPHOON_ADDRESSABLE_NAME);
274
279
  AssetDatabase.Refresh();
275
280
  AssetDatabase.SaveAssets();
281
+ Debug.Log("Addressable 支持,卸载完毕!");
276
282
  });
277
283
  }
278
284
 
@@ -285,6 +291,12 @@ namespace TyphoonUnitySDK
285
291
  return false;
286
292
  }
287
293
 
294
+ [MenuItem("TyphoonSDK/安装拓展/Toast模块", priority = 100)]
295
+ public static void InstallToast()
296
+ {
297
+ AssetDatabase.ImportPackage(UniEditor.PackagePath_Toast, true);
298
+ }
299
+
288
300
 
289
301
  /// <summary>
290
302
  /// 弹出二次提示窗口
@@ -515,5 +527,15 @@ namespace TyphoonUnitySDK
515
527
 
516
528
  File.WriteAllText(path, sb.ToString());
517
529
  }
530
+
531
+
532
+ /*发布窗口打开时触发一些事情*/
533
+ public static void CheckSomethingsOnPublishWindowShow()
534
+ {
535
+ if (Preferences.Default.CheckAddressableSupport && HasAddressable() && !HasAddressableSupport())
536
+ {
537
+ ShowMessageBox("检查到Addressable,是否添加拓展[Addressable支持],可从选项中关闭", InstallAddressableSupport);
538
+ }
539
+ }
518
540
  }
519
541
  }
@@ -75,7 +75,7 @@ namespace TyphoonUnitySDK
75
75
  return;
76
76
  }
77
77
 
78
- GUIMessageBox.Instance.Show("请选择分享返回结果", "成功返回", "失败返回", () => success?.Invoke(),
78
+ UnityGUIMessageBox.Instance.Show("请选择分享返回结果", "成功返回", "失败返回", () => success?.Invoke(),
79
79
  () => fail?.Invoke());
80
80
  }
81
81
  }
@@ -4,7 +4,10 @@ using UnityEngine;
4
4
 
5
5
  namespace TyphoonUnitySDK
6
6
  {
7
- public class GUIMessageBox : MonoSingleton<GUIMessageBox>
7
+ /// <summary>
8
+ /// 只能在Unity中调用
9
+ /// </summary>
10
+ internal class UnityGUIMessageBox : MonoSingleton<UnityGUIMessageBox>
8
11
  {
9
12
  private const float HOLD_TIME = 1.3F;
10
13
  public bool IsShow = false;
Binary file
@@ -0,0 +1,21 @@
1
+ fileFormatVersion: 2
2
+ guid: cc71c8df38c4cbc488bf89567ae58dc9
3
+ TrueTypeFontImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 4
6
+ fontSize: 16
7
+ forceTextureCase: -2
8
+ characterSpacing: 0
9
+ characterPadding: 1
10
+ includeFontData: 1
11
+ fontNames:
12
+ - ZiZhiQuXiMaiTi
13
+ fallbackFontReferences: []
14
+ customCharacters:
15
+ fontRenderingMode: 0
16
+ ascentCalculationMode: 1
17
+ useLegacyBoundsCalculation: 0
18
+ shouldRoundAdvanceValue: 1
19
+ userData:
20
+ assetBundleName:
21
+ assetBundleVariant:
@@ -0,0 +1,11 @@
1
+ Assets/Typhoon_Gen/TyphoonSDK/Toast
2
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Resources.meta
3
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Runtime.meta
4
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Toast_White.png
5
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Toast_White.png.meta
6
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/ximaiti SDF.asset
7
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/ximaiti SDF.asset.meta
8
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Resources/TYPHOON_SDK_TOAST_CANVAS.prefab
9
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Resources/TYPHOON_SDK_TOAST_CANVAS.prefab.meta
10
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Runtime/Toast.cs
11
+ Assets/Typhoon_Gen/TyphoonSDK/Toast/Runtime/Toast.cs.meta
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.24","description":"unity端个汇总渠道的sdk,统一接口,一键发布","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.25","description":"unity端个汇总渠道的sdk,统一接口,一键发布","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,38 +0,0 @@
1
- using UnityEditor;
2
-
3
- namespace TyphoonUnitySDK
4
- {
5
- [InitializeOnLoad]
6
- public class InstallModule
7
- {
8
- static InstallModule()
9
- {
10
- #if !TYPHOON_ADDRESSABLE
11
- if (Preferences.Default.CheckInstallAddressablePlug)
12
- {
13
- if (UniEditor.HasAddressable())
14
- {
15
- var complex =
16
- UniEditor.ShowMessageBoxComplex("推荐补充Addressable拓展功能,安装?\n\r可从'TyphoonSDK/选项'中关闭检查", null,
17
- null);
18
- switch (complex)
19
- {
20
- case ComplexType.Yes:
21
- UniEditor.InstallAddressableSupport();
22
- break;
23
- case ComplexType.No:
24
- break;
25
- case ComplexType.Alt:
26
- {
27
- Preferences.Default.CheckInstallAddressablePlug = false;
28
- EditorUtility.SetDirty(Preferences.Default);
29
- AssetDatabase.SaveAssets();
30
- }
31
- break;
32
- }
33
- }
34
- }
35
- #endif
36
- }
37
- }
38
- }
@@ -1,11 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: f11813434d0d7994fa4c8f275370176e
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant: