com.typhoon.unitysdk 1.0.25 → 1.0.27

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 (28) hide show
  1. package/Editor/AddressableSupport.cs +1 -1
  2. package/Editor/ApplyTool.cs +21 -0
  3. package/Editor/ExportModule.cs +20 -0
  4. package/Editor/InspectorWindow.cs +36 -0
  5. package/Editor/InspectorWindow.cs.meta +11 -0
  6. package/Editor/PublishProcess.cs +1 -0
  7. package/Editor/PublishTool.cs +2 -1
  8. package/Editor/PublishWindow.cs +1 -1
  9. package/Editor/TempPublish/TempPublishGooglePlay.cs +62 -0
  10. package/Editor/TempPublish/TempPublishGooglePlay.cs.meta +11 -0
  11. package/Editor/TempPublish/TempPublishGooglePlayEditor.cs +415 -0
  12. package/Editor/TempPublish/TempPublishGooglePlayEditor.cs.meta +11 -0
  13. package/Editor/TempPublish.meta +8 -0
  14. package/Editor/UniEditor.cs +6 -0
  15. package/Runtime/BaseSdk.cs +8 -0
  16. package/Runtime/Interface.cs +1 -0
  17. package/Runtime/SdkTestInUnity.cs +1 -0
  18. package/Runtime/TyphoonSdk.cs +15 -0
  19. package/Sources~/Package/GooglePlay.unitypackage +0 -0
  20. package/Sources~/Package/GooglePlay.unitypackage.manifest +9 -0
  21. package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
  22. package/package.json +1 -1
  23. /package/Editor/{PublishVivoBatSetting.cs → TempPublish/PublishVivoBatSetting.cs} +0 -0
  24. /package/Editor/{PublishVivoBatSetting.cs.meta → TempPublish/PublishVivoBatSetting.cs.meta} +0 -0
  25. /package/Editor/{PublishVivoBatSettingInspector.cs → TempPublish/PublishVivoBatSettingInspector.cs} +0 -0
  26. /package/Editor/{PublishVivoBatSettingInspector.cs.meta → TempPublish/PublishVivoBatSettingInspector.cs.meta} +0 -0
  27. /package/Editor/{PublishVivoBatSettingWindow.cs → TempPublish/PublishVivoBatSettingWindow.cs} +0 -0
  28. /package/Editor/{PublishVivoBatSettingWindow.cs.meta → TempPublish/PublishVivoBatSettingWindow.cs.meta} +0 -0
@@ -195,7 +195,7 @@ namespace TyphoonUnitySDK
195
195
  AddressableAssetSettings.CleanPlayerContent(builder as IDataBuilder);
196
196
  }
197
197
 
198
- UniEditor.LogInfo($"profile:{settings.profileSettings.GetProfileName(profileId)}");
198
+ Debug.Log($"profile:{settings.profileSettings.GetProfileName(profileId)}");
199
199
 
200
200
  //触发AA回调
201
201
  var sub = UniEditor.GetSubClasTypes(typeof(OnBuildAAProcessor));
@@ -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
 
@@ -454,5 +455,25 @@ namespace TyphoonUnitySDK
454
455
  AssetDatabase.Refresh();
455
456
  }
456
457
  }
458
+
459
+ /*google play*/
460
+ public class ApplyGooglePlay : IApply
461
+ {
462
+ public void Apply(PublishSetting setting)
463
+ {
464
+ Debug.Log($"导入... {UniEditor.PackagePath_GooglePlay}");
465
+ ImportUnityPackage(UniEditor.PackagePath_GooglePlay);
466
+ var manifest_path = $"{UniEditor.PackagePath_GooglePlay}.manifest";
467
+ Debug.Log($"读取资源清单...{manifest_path}");
468
+ var manifest = ReadManifest(manifest_path);
469
+ Debug.Log($"清理多余文件...");
470
+ foreach (var folder in MaybeFolder)
471
+ {
472
+ ClearFilesInDirectory(folder, manifest);
473
+ }
474
+
475
+ AssetDatabase.Refresh();
476
+ }
477
+ }
457
478
  }
458
479
  }
@@ -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:
@@ -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,
@@ -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:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 83630f12d2533a84cbd3a97b9503d2f4
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -39,6 +39,12 @@ namespace TyphoonUnitySDK
39
39
  public static string PackagePath_Douyin = $"{PathRoot}/Sources~/Package/Douyin.unitypackage";
40
40
 
41
41
 
42
+
43
+ /// <summary>
44
+ /// google play资源包
45
+ /// </summary>
46
+ public static string PackagePath_GooglePlay = $"{PathRoot}/Sources~/Package/GooglePlay.unitypackage";
47
+
42
48
  /// <summary>
43
49
  /// Toast模块
44
50
  /// </summary>
@@ -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.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
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.27","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"}}