com.typhoon.unitysdk 1.0.26 → 1.0.28

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.
Files changed (29) hide show
  1. package/Editor/ApplyTool.cs +22 -2
  2. package/Editor/ExportModule.cs +20 -0
  3. package/Editor/InspectorWindow.cs +36 -0
  4. package/Editor/InspectorWindow.cs.meta +11 -0
  5. package/Editor/PreferencesWindow.cs +0 -6
  6. package/Editor/PublishProcess.cs +1 -0
  7. package/Editor/PublishTool.cs +2 -1
  8. package/Editor/PublishWindow.cs +8 -4
  9. package/Editor/{PublishVivoBatSettingInspector.cs → TempPublish/PublishVivoBatSettingInspector.cs} +1 -0
  10. package/Editor/{PublishVivoBatSettingWindow.cs → TempPublish/PublishVivoBatSettingWindow.cs} +0 -1
  11. package/Editor/TempPublish/TempPublishGooglePlay.cs +62 -0
  12. package/Editor/TempPublish/TempPublishGooglePlay.cs.meta +11 -0
  13. package/Editor/TempPublish/TempPublishGooglePlayEditor.cs +415 -0
  14. package/Editor/TempPublish/TempPublishGooglePlayEditor.cs.meta +11 -0
  15. package/Editor/{SkinsTexture.asset.meta → TempPublish.meta} +3 -3
  16. package/Editor/UniEditor.cs +7 -2
  17. package/Runtime/BaseSdk.cs +8 -0
  18. package/Runtime/Interface.cs +1 -0
  19. package/Runtime/SdkTestInUnity.cs +1 -0
  20. package/Runtime/TyphoonSdk.cs +15 -0
  21. package/Sources~/Package/GooglePlay.unitypackage +0 -0
  22. package/Sources~/Package/GooglePlay.unitypackage.manifest +9 -0
  23. package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
  24. package/package.json +1 -1
  25. package/Editor/SkinsTexture.asset +0 -133
  26. /package/Editor/{PublishVivoBatSetting.cs → TempPublish/PublishVivoBatSetting.cs} +0 -0
  27. /package/Editor/{PublishVivoBatSetting.cs.meta → TempPublish/PublishVivoBatSetting.cs.meta} +0 -0
  28. /package/Editor/{PublishVivoBatSettingInspector.cs.meta → TempPublish/PublishVivoBatSettingInspector.cs.meta} +0 -0
  29. /package/Editor/{PublishVivoBatSettingWindow.cs.meta → TempPublish/PublishVivoBatSettingWindow.cs.meta} +0 -0
@@ -27,6 +27,7 @@ namespace TyphoonUnitySDK
27
27
  { AppChannel.WxMini, new ApplyWxMini() },
28
28
  { AppChannel.DouyinAndroid, new ApplyDouyinAndroidOrIOS() },
29
29
  { AppChannel.DouyinIOS, new ApplyDouyinAndroidOrIOS() },
30
+ { AppChannel.GooglePlay, new ApplyGooglePlay() },
30
31
  };
31
32
 
32
33
 
@@ -38,8 +39,7 @@ namespace TyphoonUnitySDK
38
39
  var done = SwitchPlatformTo(setting.BuildTarget);
39
40
  if (done)
40
41
  {
41
- //写入apply 历史
42
- UniEditor.WriteApplyHistory(setting);
42
+
43
43
  //修改参数
44
44
  switch (setting.BuildTarget)
45
45
  {
@@ -454,5 +454,25 @@ namespace TyphoonUnitySDK
454
454
  AssetDatabase.Refresh();
455
455
  }
456
456
  }
457
+
458
+ /*google play*/
459
+ public class ApplyGooglePlay : IApply
460
+ {
461
+ public void Apply(PublishSetting setting)
462
+ {
463
+ Debug.Log($"导入... {UniEditor.PackagePath_GooglePlay}");
464
+ ImportUnityPackage(UniEditor.PackagePath_GooglePlay);
465
+ var manifest_path = $"{UniEditor.PackagePath_GooglePlay}.manifest";
466
+ Debug.Log($"读取资源清单...{manifest_path}");
467
+ var manifest = ReadManifest(manifest_path);
468
+ Debug.Log($"清理多余文件...");
469
+ foreach (var folder in MaybeFolder)
470
+ {
471
+ ClearFilesInDirectory(folder, manifest);
472
+ }
473
+
474
+ AssetDatabase.Refresh();
475
+ }
476
+ }
457
477
  }
458
478
  }
@@ -82,6 +82,26 @@ namespace TyphoonUnitySDK
82
82
  ExportUnityPackage(manifest, UniEditor.PackagePath_Douyin, out var detail);
83
83
  }
84
84
 
85
+ [MenuItem("TyphoonSDK/开发者/导出-GooglePlay.unitypackage")]
86
+ public static void ExportGooglePlay()
87
+ {
88
+ var manifest = new List<string>()
89
+ {
90
+ "Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay",
91
+ };
92
+ if (!MakeSureExport(manifest))
93
+ {
94
+ return;
95
+ }
96
+
97
+ if (!CheckMissFiles(manifest))
98
+ {
99
+ return;
100
+ }
101
+
102
+ ExportUnityPackage(manifest, UniEditor.PackagePath_GooglePlay, out var detail);
103
+ }
104
+
85
105
  /// <summary>
86
106
  /// 导出清单文件到模块
87
107
  /// </summary>
@@ -0,0 +1,36 @@
1
+ using UnityEditor;
2
+ using UnityEngine;
3
+
4
+ namespace TyphoonUnitySDK
5
+ {
6
+ public class InspectorWindow : EditorWindow
7
+ {
8
+ private static Editor _bindEditor;
9
+
10
+ public static void Open(Editor editor, string title = null)
11
+ {
12
+ _bindEditor = editor;
13
+ var win = GetWindow<InspectorWindow>();
14
+ win.Show();
15
+
16
+ if (title == null)
17
+ {
18
+ title = _bindEditor.target.name;
19
+ }
20
+
21
+ win.titleContent = new GUIContent(title);
22
+ }
23
+
24
+ private void OnGUI()
25
+ {
26
+ if (_bindEditor == null)
27
+ {
28
+ Close();
29
+ }
30
+ else
31
+ {
32
+ _bindEditor.OnInspectorGUI();
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: f87b108c875026848b2168392d75187c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -8,11 +8,6 @@ namespace TyphoonUnitySDK
8
8
  {
9
9
  public class PreferencesWindow : EditorWindow
10
10
  {
11
- private static bool _preferenceFoldout = false;
12
-
13
- private static bool _wxMiniConfigFoldout = false;
14
-
15
-
16
11
  private static Vector2 _scroll;
17
12
 
18
13
  [MenuItem("TyphoonSDK/选项", priority = 10000)]
@@ -24,7 +19,6 @@ namespace TyphoonUnitySDK
24
19
  win.Show();
25
20
  }
26
21
 
27
-
28
22
  protected void OnGUI()
29
23
  {
30
24
  var rect = new Rect(0, 0, position.width, position.height);
@@ -12,5 +12,6 @@ namespace TyphoonUnitySDK
12
12
  WxMini, //微信小游戏
13
13
  DouyinAndroid,//抖音android
14
14
  DouyinIOS,//抖音ios
15
+ GooglePlay,//google play
15
16
  }
16
17
  }
@@ -24,7 +24,8 @@ namespace TyphoonUnitySDK
24
24
  { PublishProcess.ChinaAndroidAAR, "TyphoonUnitySDK.PublishChinaAndroidAAR" },
25
25
  { PublishProcess.WxMini, "TyphoonUnitySDK.PublishWxMini" },
26
26
  { PublishProcess.DouyinAndroid, "TyphoonUnitySDK.PublishDouyinAndroid" },
27
- { PublishProcess.DouyinIOS, "TyphoonUnitySDK.PublishDouyinIOS" }
27
+ { PublishProcess.DouyinIOS, "TyphoonUnitySDK.PublishDouyinIOS" },
28
+ { PublishProcess.GooglePlay, "TyphoonUnitySDK.PublishGooglePlay" }
28
29
 
29
30
  };
30
31
 
@@ -11,7 +11,7 @@ namespace TyphoonUnitySDK
11
11
  private static HashSet<AppChannel> _LockChannel = new HashSet<AppChannel>()
12
12
  {
13
13
  AppChannel.ChinaIOS,
14
- AppChannel.GooglePlay,
14
+ // AppChannel.GooglePlay,
15
15
  AppChannel.SeaIOS,
16
16
  // AppChannel.WxMini,
17
17
  AppChannel.VivoMini,
@@ -47,8 +47,6 @@ namespace TyphoonUnitySDK
47
47
  return EditorIcons.icon_vivo;
48
48
  case AppChannel.OppoMini:
49
49
  return EditorIcons.icon_oppo;
50
- default:
51
- return null;
52
50
  }
53
51
 
54
52
  return null;
@@ -221,7 +219,14 @@ namespace TyphoonUnitySDK
221
219
 
222
220
  if (GUI.Button(rectItem, new GUIContent(setting.name, GetLogo(setting.Channel)), style))
223
221
  {
222
+ var change = _select != setting;
224
223
  _select = setting;
224
+ //写入apply 历史
225
+ if (change)
226
+ {
227
+ // Debug.Log("写入历史");
228
+ UniEditor.WriteApplyHistory(setting);
229
+ }
225
230
  }
226
231
 
227
232
  if (_LockChannel.Contains(setting.Channel))
@@ -335,7 +340,6 @@ namespace TyphoonUnitySDK
335
340
  rectNextBtn.x -= 2;
336
341
  rectNextBtn.x -= rectNextBtn.width;
337
342
  bool clickBuildAA = false;
338
- var index = 0;
339
343
  if (UniEditor.HasAddressableSupport())
340
344
  {
341
345
  clickBuildAA = GUI.Button(rectNextBtn, "构建AA", Styles.rbutton_bold);
@@ -129,6 +129,7 @@ namespace TyphoonUnitySDK
129
129
 
130
130
  /*修改config.java*/
131
131
  public void WriteConfigJava()
132
+
132
133
  {
133
134
  var config =
134
135
  $@"package com.typhoon.vivo_union;
@@ -35,7 +35,6 @@ namespace TyphoonUnitySDK
35
35
  }
36
36
  }
37
37
 
38
-
39
38
  protected void OnGUI()
40
39
  {
41
40
  var rect = new Rect(0, 0, position.width, position.height);
@@ -0,0 +1,62 @@
1
+ using System.IO;
2
+ using UnityEditor;
3
+ using UnityEngine;
4
+
5
+ namespace TyphoonUnitySDK
6
+ {
7
+ public class TempPublishGooglePlay : ScriptableObject
8
+ {
9
+ private static string PATH = "Assets/Editor/TempPublishGooglePlay.asset";
10
+
11
+ [Header("android发布项目路径")]
12
+ public string AndroidPublishProj;
13
+
14
+ [Header("基础设置")]
15
+ public bool DebugMode=false;
16
+ public bool Portrait = true;
17
+
18
+ [Header("包名设置")]
19
+ public string PackageName;
20
+ public string GameName;
21
+ public int Version;
22
+ public string VersionName;
23
+ public Texture Icon;
24
+
25
+ [Header("firebase")]
26
+ public TextAsset GoogleServiceJson;
27
+
28
+ [Header("Admob")]
29
+ public string AdmobAppId;
30
+ public string IntersId;
31
+ public string VideoId;
32
+ public string BannerId;
33
+ public string NativeId;
34
+
35
+
36
+ public static TempPublishGooglePlay _default = null;
37
+
38
+ public static TempPublishGooglePlay Default
39
+ {
40
+ get
41
+ {
42
+ if (_default == null)
43
+ {
44
+ _default = AssetDatabase.LoadAssetAtPath<TempPublishGooglePlay>(PATH);
45
+ }
46
+
47
+ if (_default == null)
48
+ {
49
+ UniEditor.CreateDirIfNotExist(Path.GetDirectoryName(PATH));
50
+ _default = CreateInstance<TempPublishGooglePlay>();
51
+ AssetDatabase.CreateAsset(_default, PATH);
52
+ AssetDatabase.Refresh();
53
+ }
54
+
55
+ return _default;
56
+ }
57
+ }
58
+
59
+
60
+
61
+ }
62
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 32b82e073095dcb4293ec78781d38b1b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,415 @@
1
+ using System.Collections.Generic;
2
+ using System.IO;
3
+ using System.Linq;
4
+ using UnityEditor;
5
+ using UnityEngine;
6
+
7
+ namespace TyphoonUnitySDK
8
+ {
9
+ [CustomEditor(typeof(TempPublishGooglePlay))]
10
+ public class TempPublishGooglePlayEditor : Editor
11
+ {
12
+ [MenuItem("临时发布/发布google play")]
13
+ private static void Open()
14
+ {
15
+ InspectorWindow.Open(
16
+ Editor.CreateEditor(TempPublishGooglePlay.Default, typeof(TempPublishGooglePlayEditor)));
17
+ }
18
+
19
+ private TempPublishGooglePlay Target => target as TempPublishGooglePlay;
20
+
21
+ class ProjInfo
22
+ {
23
+ public string Path;
24
+ public long BuildTime;
25
+
26
+ public ProjInfo(string path, long buildTime)
27
+ {
28
+ Path = path;
29
+ BuildTime = buildTime;
30
+ }
31
+ }
32
+
33
+ public override void OnInspectorGUI()
34
+ {
35
+ base.OnInspectorGUI();
36
+ if (GUILayout.Button("保存配置", GUILayout.Height(44)))
37
+ {
38
+ EditorUtility.SetDirty(Target);
39
+ AssetDatabase.SaveAssets();
40
+ }
41
+
42
+ if (GUILayout.Button("一键发布", GUILayout.Height(44)))
43
+ {
44
+ UniEditor.ShowMessageBox("发布?", Publish);
45
+ }
46
+ }
47
+
48
+
49
+ private bool TryGetNearestUnityProj(out string path)
50
+ {
51
+ path = default;
52
+ var dir = $".typhoonoutput";
53
+ var directories = Directory.GetDirectories(dir);
54
+ var matches = new List<ProjInfo>();
55
+
56
+ foreach (var element in directories)
57
+ {
58
+ Debug.Log(element);
59
+ var name = Path.GetFileName(element);
60
+ Debug.Log(name);
61
+ if (name.StartsWith("google_play_"))
62
+ {
63
+ var timeString = name.Replace("google_play_", "");
64
+ if (long.TryParse(timeString, out var time))
65
+ {
66
+ Debug.Log($"加入:{element}");
67
+ matches.Add(new ProjInfo(element, time));
68
+ }
69
+ }
70
+ }
71
+
72
+ matches.Sort((a, b) => b.BuildTime.CompareTo(a.BuildTime));
73
+ if (matches.Count > 0)
74
+ {
75
+ path = matches.First().Path;
76
+ return true;
77
+ }
78
+
79
+ return false;
80
+ }
81
+
82
+
83
+ private void Publish()
84
+ {
85
+ if (!TryGetNearestUnityProj(out var unityProj))
86
+ {
87
+ UniEditor.ShowMessageBox("找不到匹配项目可以发布", null);
88
+ return;
89
+ }
90
+
91
+ if (!Directory.Exists(Target.AndroidPublishProj))
92
+ {
93
+ UniEditor.ShowMessageBox("AndroidPublishProj不可为空", null);
94
+ return;
95
+ }
96
+
97
+ Debug.Log("注入到打包工程...");
98
+ WriteAndroidManifestXml();
99
+ WriteGoogleServiceJson();
100
+ WriteConfigJava();
101
+ WriteIcon();
102
+ WriteUnityLibrary(unityProj);
103
+ WriteBuildGradle();
104
+ WriteStringsXml();
105
+ Debug.Log("处理完毕...");
106
+ }
107
+
108
+
109
+ private void WriteAndroidManifestXml()
110
+ {
111
+ var path = $@"{Target.AndroidPublishProj}\gplay\src\main\AndroidManifest.xml";
112
+ Debug.Log($"写入:{path}");
113
+ var android_manifest_xml = $@"<?xml version=""1.0"" encoding=""utf-8""?>
114
+ <manifest xmlns:android=""http://schemas.android.com/apk/res/android""
115
+ package=""com.typhoon.gplay"">
116
+
117
+ <application
118
+ android:name="".App""
119
+ android:icon=""@mipmap/app_icon""
120
+ android:label=""@string/app_name""
121
+ android:hardwareAccelerated=""true""
122
+ >
123
+ <!--admob应用id-->
124
+ <meta-data
125
+ android:name=""com.google.android.gms.ads.APPLICATION_ID""
126
+ android:value=""{Target.AdmobAppId}""/>
127
+
128
+ <activity
129
+ android:name="".LauncherActivity""
130
+ android:exported=""true""
131
+ android:configChanges=""mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density""
132
+ android:theme=""@android:style/Theme.Translucent.NoTitleBar""
133
+ >
134
+ <intent-filter>
135
+ <action android:name=""android.intent.action.MAIN"" />
136
+ <category android:name=""android.intent.category.LAUNCHER"" />
137
+ </intent-filter>
138
+ </activity>
139
+
140
+ </application>
141
+ <uses-permission android:name=""android.permission.INTERNET"" />
142
+ <uses-permission android:name=""android.permission.VIBRATE"" />
143
+ </manifest>";
144
+
145
+ File.WriteAllText(path, android_manifest_xml);
146
+ }
147
+
148
+
149
+ private void WriteGoogleServiceJson()
150
+ {
151
+ var path = $@"{Target.AndroidPublishProj}\gplay\google-services.json";
152
+
153
+ if (Target.GoogleServiceJson != null)
154
+ {
155
+ Debug.Log($"写入:{path}");
156
+ var from = AssetDatabase.GetAssetPath(Target.GoogleServiceJson);
157
+ File.Copy(from, path, true);
158
+ }
159
+ else
160
+ {
161
+ if (File.Exists(path))
162
+ {
163
+ Debug.Log($"删除:{path}");
164
+ File.Delete(path);
165
+ }
166
+ }
167
+ }
168
+
169
+
170
+ private void WriteConfigJava()
171
+ {
172
+ var path = $@"{Target.AndroidPublishProj}\gplay\src\main\java\com\typhoon\gplay\Config.java";
173
+ var java = $@"package com.typhoon.gplay;
174
+
175
+ /*打包配置*/
176
+ public class Config {{
177
+
178
+
179
+ /*启动进入demo测试页/游戏场景*/
180
+ public static boolean LAUNCHER_DEMO = false;
181
+
182
+ /*Debug 模式开关*/
183
+ public static boolean DEBUG_MODE = {Target.DebugMode.ToString().ToLower()};
184
+
185
+ /*竖屏模式为true,横屏模式为false*/
186
+ public static boolean ORIENTATION_PORTRAIT = {Target.Portrait.ToString().ToLower()};;
187
+
188
+ /*admob插页*/
189
+ public static String ADMOB_INTERS_UNIT = ""{Target.IntersId}"";
190
+ /*admob激励视频*/
191
+ public static String ADMOB_VIDEO_UNIT = ""{Target.VideoId}"";
192
+ /*admob banner*/
193
+ public static String ADMOB_BANNER_UNIT = """";
194
+ /*admob 原生广告*/
195
+ public static String ADMOB_NATIVE_UNIT = """";
196
+
197
+ }}
198
+ ";
199
+ Debug.Log($"写入:{path}");
200
+ File.WriteAllText(path, java);
201
+ }
202
+
203
+
204
+ private void WriteIcon()
205
+ {
206
+ var path = $@"{Target.AndroidPublishProj}\gplay\src\main\res\mipmap-mdpi\app_icon.png";
207
+ if (Target.Icon != null)
208
+ {
209
+ var from = AssetDatabase.GetAssetPath(Target.Icon);
210
+ Debug.Log($"写入:{path}");
211
+ File.Copy(from, path, true);
212
+ }
213
+ }
214
+
215
+ private void WriteUnityLibrary(string unityProj)
216
+ {
217
+
218
+ var androidUnityLib = $@"{Target.AndroidPublishProj}\unityLibrary";
219
+ var unityLib = $"{unityProj}/unityLibrary";
220
+ if (Directory.Exists(unityLib))
221
+ {
222
+ Debug.Log("更换unitylib");
223
+ Directory.Delete(androidUnityLib,true);
224
+ UniEditor.CopyFolder(unityLib,androidUnityLib);
225
+ }
226
+
227
+ var xmlPath = $@"{androidUnityLib}\src\main\AndroidManifest.xml";
228
+ var xml = File.ReadAllText(xmlPath);
229
+ xml = xml.Replace("<intent-filter>", "");
230
+ xml = xml.Replace("<action android:name=\"android.intent.action.MAIN\" />", "");
231
+ xml = xml.Replace("<category android:name=\"android.intent.category.LAUNCHER\" />", "");
232
+ xml = xml.Replace("</intent-filter>", "");
233
+ Debug.Log($"写入:{xmlPath}");
234
+ File.WriteAllText(xmlPath, xml);
235
+
236
+ // var xmlAndroid = $"{androidUnityLib}/src/main/AndroidManifest.xml";
237
+ // var xmlUnity = $"{unityLib}/src/main/AndroidManifest.xml";
238
+ //
239
+ // var map = new (string androidPath, string unityPath)[]
240
+ // {
241
+ // //{unityProj}\unityLibrary
242
+ // ($"{androidUnityLib}/libs", $"{unityLib}/libs"),
243
+ // ($"{androidUnityLib}/src/main/assets", $"{unityLib}/src/main/assets"),
244
+ // ($"{androidUnityLib}/src/main/java", $"{unityLib}/src/main/java"),
245
+ // ($"{androidUnityLib}/src/main/jniLibs", $"{unityLib}/src/main/jniLibs"),
246
+ //
247
+ // };
248
+ //
249
+ //
250
+ // foreach (var e in map)
251
+ // {
252
+ // UniEditor.TryDeleteFolder(e.androidPath);
253
+ // UniEditor.CopyFolder(e.unityPath, e.androidPath);
254
+ // Debug.Log($"写入:{e.androidPath} ");
255
+ // }
256
+ //
257
+ // File.Copy(xmlUnity, xmlAndroid, true);
258
+ // Debug.Log($"复制:{xmlUnity}-->{xmlAndroid} ");
259
+ // var xmlPath = $@"{androidUnityLib}\src\main\AndroidManifest.xml";
260
+ // var xml = File.ReadAllText(xmlPath);
261
+ // xml = xml.Replace("<intent-filter>", "");
262
+ // xml = xml.Replace("<action android:name=\"android.intent.action.MAIN\" />", "");
263
+ // xml = xml.Replace("<category android:name=\"android.intent.category.LAUNCHER\" />", "");
264
+ // xml = xml.Replace("</intent-filter>", "");
265
+ // File.WriteAllText(xmlPath, xml);
266
+ // Debug.Log($"写入:{xmlPath}");
267
+ //
268
+ // var gradle = $@"{Target.AndroidPublishProj}\unityLibrary\build.gradle";
269
+ // var gradle_from = $"{unityLib}/build.gradle";
270
+ // Debug.Log($"写入:{gradle}");
271
+ // File.Copy(gradle_from,gradle,true);
272
+ }
273
+
274
+ private void WriteBuildGradle()
275
+ {
276
+ var path = $@"{Target.AndroidPublishProj}\gplay\build.gradle";
277
+ var gradle = $@"import java.text.SimpleDateFormat
278
+
279
+ apply plugin: 'com.android.application'
280
+ apply plugin: 'com.google.gms.google-services'
281
+ android {{
282
+ compileSdkVersion 33
283
+ buildToolsVersion '30.0.3'
284
+
285
+
286
+ compileOptions {{
287
+ sourceCompatibility JavaVersion.VERSION_1_8
288
+ targetCompatibility JavaVersion.VERSION_1_8
289
+ }}
290
+
291
+ /*签名配置*/
292
+ signingConfigs {{
293
+ release {{
294
+ def signDir = rootProject.file('sign')
295
+ keyAlias 'key0'
296
+ keyPassword '123456798'
297
+ storeFile file(signDir.getAbsolutePath() + '/fishing.jks')
298
+ storePassword '123456798'
299
+ }}
300
+
301
+ debug {{
302
+ def signDir = rootProject.file('sign')
303
+ keyAlias 'key0'
304
+ keyPassword '123456798'
305
+ storeFile file(signDir.getAbsolutePath() + '/fishing.jks')
306
+ storePassword '123456798'
307
+ }}
308
+ }}
309
+
310
+
311
+ defaultConfig {{
312
+ minSdkVersion 21
313
+ targetSdkVersion 33
314
+ versionCode {Target.Version}
315
+ versionName '{Target.VersionName}'
316
+ applicationId '{Target.PackageName}'
317
+ consumerProguardFiles ""consumer-rules.pro""
318
+ ndk {{
319
+ abiFilters 'armeabi-v7a', 'arm64-v8a'
320
+ }}
321
+ }}
322
+
323
+
324
+ //发布的包名
325
+ applicationVariants.all {{ variant ->
326
+ variant.outputs.all {{
327
+ def formattedDate = new SimpleDateFormat(""yyyyMMdd_HHmmss"").format(new Date())
328
+ def versionName = variant.versionName
329
+ def buildType = variant.buildType.name
330
+ def appName = variant.applicationId
331
+ outputFileName = ""${{appName}}_v${{versionName}}_${{buildType}}_${{formattedDate}}.apk""
332
+ }}
333
+ }}
334
+
335
+
336
+ sourceSets {{
337
+ main {{
338
+ jniLibs.srcDirs = ['libs']
339
+ }}
340
+ }}
341
+
342
+ aaptOptions {{
343
+ noCompress = ['.unity3d', '.ress', '.resource', '.obb', 'aa/catalog.json', 'aa/settings.json', 'aa/AddressablesLink/link.xml', '.bundle']
344
+ ignoreAssetsPattern = ""!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~""
345
+ }}
346
+
347
+ lintOptions {{
348
+ abortOnError false
349
+ }}
350
+
351
+ buildTypes {{
352
+ debug {{
353
+ minifyEnabled false
354
+ useProguard false
355
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', getDefaultProguardFile('proguard-android-optimize.txt')
356
+ signingConfig signingConfigs.debug
357
+ jniDebuggable true
358
+ }}
359
+ release {{
360
+ minifyEnabled false
361
+ useProguard false
362
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', getDefaultProguardFile('proguard-android-optimize.txt')
363
+ signingConfig signingConfigs.release
364
+
365
+ }}
366
+ }}
367
+
368
+ packagingOptions {{
369
+ doNotStrip '*/armeabi-v7a/*.so'
370
+ doNotStrip '*/arm64-v8a/*.so'
371
+ }}
372
+
373
+
374
+ bundle {{
375
+ language {{
376
+ enableSplit = false
377
+ }}
378
+ density {{
379
+ enableSplit = false
380
+ }}
381
+ abi {{
382
+ enableSplit = true
383
+ }}
384
+ }}
385
+
386
+ }}
387
+
388
+ dependencies {{
389
+ api fileTree(includes: ['*.jar', '*.aar'], dir: 'libs')
390
+ api project(':sdk_plug')
391
+ api project(':unity_app')
392
+ api platform('com.google.firebase:firebase-bom:32.2.3')
393
+ api 'com.google.firebase:firebase-analytics:21.3.0'
394
+ api 'com.google.android.gms:play-services-ads:21.3.0'
395
+ }}";
396
+
397
+
398
+ Debug.Log($"写入:{path}");
399
+ File.WriteAllText(path, gradle);
400
+ }
401
+
402
+
403
+ private void WriteStringsXml()
404
+ {
405
+ var path = $@"{Target.AndroidPublishProj}\gplay\src\main\res\values\strings.xml";
406
+ var xml = $@"<?xml version=""1.0"" encoding=""utf-8""?>
407
+ <resources>
408
+ <string name=""app_name"">{Target.GameName}</string>
409
+ <string name=""game_view_content_description"">Game view</string>
410
+ </resources>";
411
+ Debug.Log($"写入:{path}");
412
+ File.WriteAllText(path, xml);
413
+ }
414
+ }
415
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 5441d7772f3516540bd2e6a2bbb8ac1d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
1
  fileFormatVersion: 2
2
- guid: b483135a891a1bc4ea22f8cd1bc29431
3
- NativeFormatImporter:
2
+ guid: 83630f12d2533a84cbd3a97b9503d2f4
3
+ folderAsset: yes
4
+ DefaultImporter:
4
5
  externalObjects: {}
5
- mainObjectFileID: 11400000
6
6
  userData:
7
7
  assetBundleName:
8
8
  assetBundleVariant:
@@ -39,6 +39,11 @@ namespace TyphoonUnitySDK
39
39
  public static string PackagePath_Douyin = $"{PathRoot}/Sources~/Package/Douyin.unitypackage";
40
40
 
41
41
 
42
+ /// <summary>
43
+ /// google play资源包
44
+ /// </summary>
45
+ public static string PackagePath_GooglePlay = $"{PathRoot}/Sources~/Package/GooglePlay.unitypackage";
46
+
42
47
  /// <summary>
43
48
  /// Toast模块
44
49
  /// </summary>
@@ -53,7 +58,7 @@ namespace TyphoonUnitySDK
53
58
  /// <summary>
54
59
  /// apply历史记录
55
60
  /// </summary>
56
- public static readonly string APPLY_HISTORY = "Temp/typhoon_apply_history.txt";
61
+ public static readonly string APPLY_HISTORY = ".typhoon/typhoon_sdk_apply_history.txt";
57
62
 
58
63
 
59
64
  /// <summary>
@@ -399,7 +404,7 @@ namespace TyphoonUnitySDK
399
404
  sb.Append($".{current}");
400
405
  return sb.ToString();
401
406
  }
402
- catch (Exception e)
407
+ catch (Exception)
403
408
  {
404
409
  Debug.LogError("无法识别版本号格式");
405
410
  }
@@ -39,6 +39,14 @@ namespace TyphoonUnitySDK
39
39
  {
40
40
  }
41
41
 
42
+
43
+ /*获取激励视频标记*/
44
+ public virtual bool GetVideoFlag()
45
+ {
46
+ return true;
47
+ }
48
+
49
+
42
50
  /*展示视频广告*/
43
51
  public virtual void ShowVideo(string scene, Action success, Action<string> fail)
44
52
  {
@@ -56,6 +56,7 @@ namespace TyphoonUnitySDK
56
56
  /*视频广告*/
57
57
  public interface IVideoAD
58
58
  {
59
+ bool GetVideoFlag();
59
60
  void ShowVideo(string scene, Action success, Action<string> fail);
60
61
  }
61
62
 
@@ -14,6 +14,7 @@ public class SdkTestInUnity : ScriptableObject
14
14
  [Header("开启交互式测试")] public bool OpenInteractive = true;
15
15
  [Header("交互式测试悬停关闭检测时间")] public float InteractiveHoldCloseTime = 1.2f;
16
16
  [Header("视频广告回调")] public bool ShowVideoResult = true;
17
+ [Header("视频广告flag")] public bool GetVideoFlagResult = true;
17
18
 
18
19
 
19
20
  private static SdkTestInUnity _instance = null;
@@ -18,6 +18,7 @@ namespace TyphoonUnitySDK
18
18
  { AppChannel.WxMini, "TYPHOON_SDK_WX_MINI" }, //微信小游戏
19
19
  { AppChannel.DouyinAndroid, "TYPHOON_SDK_DOUYIN_MINI" }, //抖音小游戏
20
20
  { AppChannel.DouyinIOS, "TYPHOON_SDK_DOUYIN_MINI" }, //抖音小游戏
21
+ { AppChannel.GooglePlay, "TYPHOON_SDK_GOOGLE_PLAY" }, //GooglePlay
21
22
  };
22
23
 
23
24
  private ISdk _sdk;
@@ -139,6 +140,20 @@ namespace TyphoonUnitySDK
139
140
 
140
141
  #region 视频广告
141
142
 
143
+ /// <summary>
144
+ /// 获取视频广告加载标记
145
+ /// </summary>
146
+ public bool GetVideoFlag()
147
+ {
148
+ Log($"GetVideoFlag...");
149
+ #if UNITY_EDITOR
150
+ return SdkTestInUnity.Instance.GetVideoFlagResult;
151
+ #endif
152
+ var flag = _sdk.GetVideoFlag();
153
+ Log($"get video flag : {flag}");
154
+ return flag;
155
+ }
156
+
142
157
  /// <summary>
143
158
  /// 视频广告
144
159
  /// </summary>
@@ -0,0 +1,9 @@
1
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay
2
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/Editor.meta
3
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/GooglePlaySdk.cs
4
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/GooglePlaySdk.cs.meta
5
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/Resources.meta
6
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/Editor/PublishGooglePlay.cs
7
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/Editor/PublishGooglePlay.cs.meta
8
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/Resources/TYPHOON_SDK_GOOGLE_PLAY.prefab
9
+ Assets/Typhoon_Gen/TyphoonSDK/Runtime/GooglePlay/Resources/TYPHOON_SDK_GOOGLE_PLAY.prefab.meta
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.26","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.28","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,133 +0,0 @@
1
- %YAML 1.1
2
- %TAG !u! tag:unity3d.com,2011:
3
- --- !u!114 &11400000
4
- MonoBehaviour:
5
- m_ObjectHideFlags: 0
6
- m_CorrespondingSourceObject: {fileID: 0}
7
- m_PrefabInstance: {fileID: 0}
8
- m_PrefabAsset: {fileID: 0}
9
- m_GameObject: {fileID: 0}
10
- m_Enabled: 1
11
- m_EditorHideFlags: 0
12
- m_Script: {fileID: 11500000, guid: b4b13ba135089db49ac6aa3f0aa8e564, type: 3}
13
- m_Name: SkinsTexture
14
- m_EditorClassIdentifier:
15
- Texture2D:
16
- - Name: box@2x
17
- Texture2D: {fileID: 0}
18
- - Name: btn act@2x
19
- Texture2D: {fileID: 0}
20
- - Name: btn on@2x
21
- Texture2D: {fileID: 0}
22
- - Name: btn onact@2x
23
- Texture2D: {fileID: 0}
24
- - Name: btn@2x
25
- Texture2D: {fileID: 0}
26
- - Name: btn_active
27
- Texture2D: {fileID: 0}
28
- - Name: btn_blue_active
29
- Texture2D: {fileID: 0}
30
- - Name: btn_blue_hover
31
- Texture2D: {fileID: 0}
32
- - Name: btn_blue_normal
33
- Texture2D: {fileID: 0}
34
- - Name: btn_green_active
35
- Texture2D: {fileID: 0}
36
- - Name: btn_green_hover
37
- Texture2D: {fileID: 0}
38
- - Name: btn_green_normal
39
- Texture2D: {fileID: 0}
40
- - Name: btn_hover
41
- Texture2D: {fileID: 0}
42
- - Name: btn_normal
43
- Texture2D: {fileID: 0}
44
- - Name: btn_yellow_active
45
- Texture2D: {fileID: 0}
46
- - Name: btn_yellow_hover
47
- Texture2D: {fileID: 0}
48
- - Name: btn_yellow_normal
49
- Texture2D: {fileID: 0}
50
- - Name: buttonpulldown act@2x
51
- Texture2D: {fileID: 0}
52
- - Name: buttonpulldown@2x
53
- Texture2D: {fileID: 0}
54
- - Name: PopupWindowOff
55
- Texture2D: {fileID: 0}
56
- - Name: PopupWindowOff@2x
57
- Texture2D: {fileID: 0}
58
- - Name: PopupWindowOn
59
- Texture2D: {fileID: 0}
60
- - Name: PopupWindowOn@2x
61
- Texture2D: {fileID: 0}
62
- - Name: scroll horiz left act@2x
63
- Texture2D: {fileID: 0}
64
- - Name: scroll horiz left@2x
65
- Texture2D: {fileID: 0}
66
- - Name: scroll horiz right act@2x
67
- Texture2D: {fileID: 0}
68
- - Name: scroll horiz right@2x
69
- Texture2D: {fileID: 0}
70
- - Name: scroll horiz thumb@2x
71
- Texture2D: {fileID: 0}
72
- - Name: scroll horiz@2x
73
- Texture2D: {fileID: 0}
74
- - Name: scroll vert down act@2x
75
- Texture2D: {fileID: 0}
76
- - Name: scroll vert down@2x
77
- Texture2D: {fileID: 0}
78
- - Name: scroll vert thumb@2x
79
- Texture2D: {fileID: 0}
80
- - Name: scroll vert up act@2x
81
- Texture2D: {fileID: 0}
82
- - Name: scroll vert up@2x
83
- Texture2D: {fileID: 0}
84
- - Name: scroll vert@2x
85
- Texture2D: {fileID: 0}
86
- - Name: search focused@2x
87
- Texture2D: {fileID: 0}
88
- - Name: search@2x
89
- Texture2D: {fileID: 0}
90
- - Name: searchCancelButton@2x
91
- Texture2D: {fileID: 0}
92
- - Name: searchCancelButtonActive@2x
93
- Texture2D: {fileID: 0}
94
- - Name: searchCancelButtonOff@2x
95
- Texture2D: {fileID: 0}
96
- - Name: slider horiz@2x
97
- Texture2D: {fileID: 0}
98
- - Name: slider thumb act@2x
99
- Texture2D: {fileID: 0}
100
- - Name: slider thumb focus@2x
101
- Texture2D: {fileID: 0}
102
- - Name: slider thumb@2x
103
- Texture2D: {fileID: 0}
104
- - Name: slider vert@2x
105
- Texture2D: {fileID: 0}
106
- - Name: TextField focused@2x
107
- Texture2D: {fileID: 0}
108
- - Name: TextField@2x
109
- Texture2D: {fileID: 0}
110
- - Name: toggle act@2x
111
- Texture2D: {fileID: 0}
112
- - Name: toggle focus@2x
113
- Texture2D: {fileID: 0}
114
- - Name: toggle on act@2x
115
- Texture2D: {fileID: 0}
116
- - Name: toggle on focus@2x
117
- Texture2D: {fileID: 0}
118
- - Name: toggle on@2x
119
- Texture2D: {fileID: 0}
120
- - Name: toggle@2x
121
- Texture2D: {fileID: 0}
122
- - Name: toolbar button act on@2x
123
- Texture2D: {fileID: 0}
124
- - Name: toolbar button act@2x
125
- Texture2D: {fileID: 0}
126
- - Name: toolbar button on@2x
127
- Texture2D: {fileID: 0}
128
- - Name: toolbar button@2x
129
- Texture2D: {fileID: 0}
130
- - Name: toolbar popup@2x
131
- Texture2D: {fileID: 0}
132
- - Name: toolbar pulldown@2x
133
- Texture2D: {fileID: 0}