com.typhoon.unitysdk 1.0.2
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/AddressableSupport.cs +269 -0
- package/Editor/AddressableSupport.cs.meta +11 -0
- package/Editor/ApplyTool.cs +315 -0
- package/Editor/ApplyTool.cs.meta +11 -0
- package/Editor/EditorIcons.cs +113 -0
- package/Editor/EditorIcons.cs.meta +11 -0
- package/Editor/ExportModule.cs +218 -0
- package/Editor/ExportModule.cs.meta +11 -0
- package/Editor/InstallModule.cs +38 -0
- package/Editor/InstallModule.cs.meta +11 -0
- package/Editor/Interactive/SDKInteractiveUI.prefab +3026 -0
- package/Editor/Interactive/SDKInteractiveUI.prefab.meta +7 -0
- package/Editor/Interactive/sdk_banner.png +0 -0
- package/Editor/Interactive/sdk_banner.png.meta +144 -0
- package/Editor/Interactive/sdk_close.png +0 -0
- package/Editor/Interactive/sdk_close.png.meta +120 -0
- package/Editor/Interactive/sdk_inters.png +0 -0
- package/Editor/Interactive/sdk_inters.png.meta +120 -0
- package/Editor/Interactive/sdk_white_4x4.png +0 -0
- package/Editor/Interactive/sdk_white_4x4.png.meta +120 -0
- package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png +0 -0
- package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png.meta +120 -0
- package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png +0 -0
- package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png.meta +120 -0
- package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png +0 -0
- package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png.meta +120 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/345/216/237/347/224/237/346/250/241/346/235/277.png +0 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/345/216/237/347/224/237/346/250/241/346/235/277.png.meta +120 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/346/217/222/351/241/265/345/271/277/345/221/212.png +0 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/346/217/222/351/241/265/345/271/277/345/221/212.png.meta +120 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/350/247/206/351/242/221/345/271/277/345/221/212.png +0 -0
- package/Editor/Interactive/sdk_/350/277/231/346/230/257/344/270/200/344/270/252/350/247/206/351/242/221/345/271/277/345/221/212.png.meta +120 -0
- package/Editor/Interactive.meta +8 -0
- package/Editor/OnApplyProcessor.cs +22 -0
- package/Editor/OnApplyProcessor.cs.meta +11 -0
- package/Editor/OnBuildAAProcessor.cs +12 -0
- package/Editor/OnBuildAAProcessor.cs.meta +11 -0
- package/Editor/OnPublicProcessor.cs +12 -0
- package/Editor/OnPublicProcessor.cs.meta +11 -0
- package/Editor/OriginalStyles.cs +708 -0
- package/Editor/OriginalStyles.cs.meta +11 -0
- package/Editor/Preferences.cs +43 -0
- package/Editor/Preferences.cs.meta +11 -0
- package/Editor/PreferencesWindow.cs +178 -0
- package/Editor/PreferencesWindow.cs.meta +11 -0
- package/Editor/PropertyInspectorEditor.cs +6 -0
- package/Editor/PropertyInspectorEditor.cs.meta +11 -0
- package/Editor/PublishProcess.cs +13 -0
- package/Editor/PublishProcess.cs.meta +11 -0
- package/Editor/PublishResult.cs +17 -0
- package/Editor/PublishResult.cs.meta +11 -0
- package/Editor/PublishSetting.cs +111 -0
- package/Editor/PublishSetting.cs.meta +11 -0
- package/Editor/PublishSettingGUIDrawer.cs +412 -0
- package/Editor/PublishSettingGUIDrawer.cs.meta +11 -0
- package/Editor/PublishSettingInspector.cs +29 -0
- package/Editor/PublishSettingInspector.cs.meta +11 -0
- package/Editor/PublishTool.cs +137 -0
- package/Editor/PublishTool.cs.meta +11 -0
- package/Editor/PublishVivoBatSetting.cs +62 -0
- package/Editor/PublishVivoBatSetting.cs.meta +11 -0
- package/Editor/PublishVivoBatSettingInspector.cs +371 -0
- package/Editor/PublishVivoBatSettingInspector.cs.meta +11 -0
- package/Editor/PublishVivoBatSettingWindow.cs +69 -0
- package/Editor/PublishVivoBatSettingWindow.cs.meta +11 -0
- package/Editor/PublishWindow.cs +364 -0
- package/Editor/PublishWindow.cs.meta +11 -0
- package/Editor/SdkFont.otf +0 -0
- package/Editor/SdkFont.otf.meta +21 -0
- package/Editor/SdkTestInUnityEditor.cs +20 -0
- package/Editor/SdkTestInUnityEditor.cs.meta +11 -0
- package/Editor/SdkTestInUnityWindow.cs +37 -0
- package/Editor/SdkTestInUnityWindow.cs.meta +11 -0
- package/Editor/Skin.guiskin +2673 -0
- package/Editor/Skin.guiskin.meta +8 -0
- package/Editor/Skins.cs +26 -0
- package/Editor/Skins.cs.meta +11 -0
- package/Editor/StyleEditorWindow.cs +23 -0
- package/Editor/StyleEditorWindow.cs.meta +11 -0
- package/Editor/Styles.cs +52 -0
- package/Editor/Styles.cs.meta +11 -0
- package/Editor/StylesExtension.cs +25 -0
- package/Editor/StylesExtension.cs.meta +11 -0
- package/Editor/Texture/btn_active.png +0 -0
- package/Editor/Texture/btn_active.png.meta +120 -0
- package/Editor/Texture/btn_blue_active.png +0 -0
- package/Editor/Texture/btn_blue_active.png.meta +120 -0
- package/Editor/Texture/btn_blue_hover.png +0 -0
- package/Editor/Texture/btn_blue_hover.png.meta +120 -0
- package/Editor/Texture/btn_blue_normal.png +0 -0
- package/Editor/Texture/btn_blue_normal.png.meta +120 -0
- package/Editor/Texture/btn_green_active.png +0 -0
- package/Editor/Texture/btn_green_active.png.meta +120 -0
- package/Editor/Texture/btn_green_hover.png +0 -0
- package/Editor/Texture/btn_green_hover.png.meta +120 -0
- package/Editor/Texture/btn_green_normal.png +0 -0
- package/Editor/Texture/btn_green_normal.png.meta +120 -0
- package/Editor/Texture/btn_hover.png +0 -0
- package/Editor/Texture/btn_hover.png.meta +120 -0
- package/Editor/Texture/btn_normal.png +0 -0
- package/Editor/Texture/btn_normal.png.meta +120 -0
- package/Editor/Texture/btn_yellow_active.png +0 -0
- package/Editor/Texture/btn_yellow_active.png.meta +120 -0
- package/Editor/Texture/btn_yellow_hover.png +0 -0
- package/Editor/Texture/btn_yellow_hover.png.meta +120 -0
- package/Editor/Texture/btn_yellow_normal.png +0 -0
- package/Editor/Texture/btn_yellow_normal.png.meta +120 -0
- package/Editor/Texture/icon_android.png +0 -0
- package/Editor/Texture/icon_android.png.meta +120 -0
- package/Editor/Texture/icon_douyin.png +0 -0
- package/Editor/Texture/icon_douyin.png.meta +120 -0
- package/Editor/Texture/icon_download.png +0 -0
- package/Editor/Texture/icon_download.png.meta +120 -0
- package/Editor/Texture/icon_error.png +0 -0
- package/Editor/Texture/icon_error.png.meta +144 -0
- package/Editor/Texture/icon_extension.png +0 -0
- package/Editor/Texture/icon_extension.png.meta +120 -0
- package/Editor/Texture/icon_googleplay.png +0 -0
- package/Editor/Texture/icon_googleplay.png.meta +120 -0
- package/Editor/Texture/icon_html5.png +0 -0
- package/Editor/Texture/icon_html5.png.meta +120 -0
- package/Editor/Texture/icon_import.png +0 -0
- package/Editor/Texture/icon_import.png.meta +144 -0
- package/Editor/Texture/icon_ios.png +0 -0
- package/Editor/Texture/icon_ios.png.meta +120 -0
- package/Editor/Texture/icon_oppo.png +0 -0
- package/Editor/Texture/icon_oppo.png.meta +120 -0
- package/Editor/Texture/icon_refresh.png +0 -0
- package/Editor/Texture/icon_refresh.png.meta +120 -0
- package/Editor/Texture/icon_save.png +0 -0
- package/Editor/Texture/icon_save.png.meta +120 -0
- package/Editor/Texture/icon_success.png +0 -0
- package/Editor/Texture/icon_success.png.meta +144 -0
- package/Editor/Texture/icon_vivo.png +0 -0
- package/Editor/Texture/icon_vivo.png.meta +120 -0
- package/Editor/Texture/icon_wechat.png +0 -0
- package/Editor/Texture/icon_wechat.png.meta +120 -0
- package/Editor/Texture/tex_select.png +0 -0
- package/Editor/Texture/tex_select.png.meta +120 -0
- package/Editor/Texture.meta +8 -0
- package/Editor/UniEditor.cs +451 -0
- package/Editor/UniEditor.cs.meta +11 -0
- package/Editor/com.typhoon.unitysdk.editor.asmdef +20 -0
- package/Editor/com.typhoon.unitysdk.editor.asmdef.meta +7 -0
- package/Editor.meta +8 -0
- package/Runtime/AndroidInstance.cs +125 -0
- package/Runtime/AndroidInstance.cs.meta +11 -0
- package/Runtime/AppChannel.cs +55 -0
- package/Runtime/AppChannel.cs.meta +11 -0
- package/Runtime/AppConfig.cs +28 -0
- package/Runtime/AppConfig.cs.meta +11 -0
- package/Runtime/AppConfigAsset.cs +50 -0
- package/Runtime/AppConfigAsset.cs.meta +11 -0
- package/Runtime/BannerPosition.cs +11 -0
- package/Runtime/BannerPosition.cs.meta +11 -0
- package/Runtime/BaseSdk.cs +78 -0
- package/Runtime/BaseSdk.cs.meta +11 -0
- package/Runtime/Extension.cs +58 -0
- package/Runtime/Extension.cs.meta +11 -0
- package/Runtime/Interface.cs +115 -0
- package/Runtime/Interface.cs.meta +11 -0
- package/Runtime/MonoSingleton.cs +76 -0
- package/Runtime/MonoSingleton.cs.meta +11 -0
- package/Runtime/Resources/TYPHOON_SDK_TEST.prefab +45 -0
- package/Runtime/Resources/TYPHOON_SDK_TEST.prefab.meta +7 -0
- package/Runtime/Resources.meta +8 -0
- package/Runtime/SDKInteractiveUI.cs +353 -0
- package/Runtime/SDKInteractiveUI.cs.meta +11 -0
- package/Runtime/SdkDebug.cs +23 -0
- package/Runtime/SdkDebug.cs.meta +11 -0
- package/Runtime/SdkTestInUnity.cs +45 -0
- package/Runtime/SdkTestInUnity.cs.meta +11 -0
- package/Runtime/SessionItem.cs +72 -0
- package/Runtime/SessionItem.cs.meta +11 -0
- package/Runtime/SimpleMap.cs +11 -0
- package/Runtime/SimpleMap.cs.meta +11 -0
- package/Runtime/TestSdk.cs +22 -0
- package/Runtime/TestSdk.cs.meta +11 -0
- package/Runtime/TyphoonSdk.cs +407 -0
- package/Runtime/TyphoonSdk.cs.meta +11 -0
- package/Runtime/TyphoonSdkCallback.cs +48 -0
- package/Runtime/TyphoonSdkCallback.cs.meta +11 -0
- package/Runtime/VersionType.cs +33 -0
- package/Runtime/VersionType.cs.meta +11 -0
- package/Runtime/com.typhoon.unitysdk.asmdef +3 -0
- package/Runtime/com.typhoon.unitysdk.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/AndroidManifest.xml +18 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/AndroidManifest.xml.meta +7 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/sdk_plug-release.aar +0 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/sdk_plug-release.aar.meta +32 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_app-release.aar +0 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_app-release.aar.meta +32 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_launcher-release.aar +0 -0
- package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_launcher-release.aar.meta +32 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs +154 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs.meta +11 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs +56 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs.meta +11 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor.meta +8 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources/TYPHOON_SDK_CHINA_ANDROID.prefab +45 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources/TYPHOON_SDK_CHINA_ANDROID.prefab.meta +7 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources.meta +8 -0
- package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid.meta +8 -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 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
using UnityEditor;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace TyphoonUnitySDK
|
|
5
|
+
{
|
|
6
|
+
public class EditorIcons
|
|
7
|
+
{
|
|
8
|
+
private static string _folderPath = null;
|
|
9
|
+
private static string FolderPath => _folderPath ?? $"{UniEditor.PathRoot}/Editor/Texture";
|
|
10
|
+
private static Texture __btn_active = null;
|
|
11
|
+
public static Texture btn_active =>
|
|
12
|
+
__btn_active ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_active.png");
|
|
13
|
+
private static Texture __btn_blue_active = null;
|
|
14
|
+
public static Texture btn_blue_active =>
|
|
15
|
+
__btn_blue_active
|
|
16
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_blue_active.png");
|
|
17
|
+
private static Texture __btn_blue_hover = null;
|
|
18
|
+
public static Texture btn_blue_hover =>
|
|
19
|
+
__btn_blue_hover
|
|
20
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_blue_hover.png");
|
|
21
|
+
private static Texture __btn_blue_normal = null;
|
|
22
|
+
public static Texture btn_blue_normal =>
|
|
23
|
+
__btn_blue_normal
|
|
24
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_blue_normal.png");
|
|
25
|
+
private static Texture __btn_green_active = null;
|
|
26
|
+
public static Texture btn_green_active =>
|
|
27
|
+
__btn_green_active
|
|
28
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_green_active.png");
|
|
29
|
+
private static Texture __btn_green_hover = null;
|
|
30
|
+
public static Texture btn_green_hover =>
|
|
31
|
+
__btn_green_hover
|
|
32
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_green_hover.png");
|
|
33
|
+
private static Texture __btn_green_normal = null;
|
|
34
|
+
public static Texture btn_green_normal =>
|
|
35
|
+
__btn_green_normal
|
|
36
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_green_normal.png");
|
|
37
|
+
private static Texture __btn_hover = null;
|
|
38
|
+
public static Texture btn_hover =>
|
|
39
|
+
__btn_hover ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_hover.png");
|
|
40
|
+
private static Texture __btn_normal = null;
|
|
41
|
+
public static Texture btn_normal =>
|
|
42
|
+
__btn_normal ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_normal.png");
|
|
43
|
+
private static Texture __btn_yellow_active = null;
|
|
44
|
+
public static Texture btn_yellow_active =>
|
|
45
|
+
__btn_yellow_active
|
|
46
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_yellow_active.png");
|
|
47
|
+
private static Texture __btn_yellow_hover = null;
|
|
48
|
+
public static Texture btn_yellow_hover =>
|
|
49
|
+
__btn_yellow_hover
|
|
50
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_yellow_hover.png");
|
|
51
|
+
private static Texture __btn_yellow_normal = null;
|
|
52
|
+
public static Texture btn_yellow_normal =>
|
|
53
|
+
__btn_yellow_normal
|
|
54
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/btn_yellow_normal.png");
|
|
55
|
+
private static Texture __icon_android = null;
|
|
56
|
+
public static Texture icon_android =>
|
|
57
|
+
__icon_android
|
|
58
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_android.png");
|
|
59
|
+
private static Texture __icon_douyin = null;
|
|
60
|
+
public static Texture icon_douyin =>
|
|
61
|
+
__icon_douyin
|
|
62
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_douyin.png");
|
|
63
|
+
private static Texture __icon_download = null;
|
|
64
|
+
public static Texture icon_download =>
|
|
65
|
+
__icon_download
|
|
66
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_download.png");
|
|
67
|
+
private static Texture __icon_error = null;
|
|
68
|
+
public static Texture icon_error =>
|
|
69
|
+
__icon_error ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_error.png");
|
|
70
|
+
private static Texture __icon_extension = null;
|
|
71
|
+
public static Texture icon_extension =>
|
|
72
|
+
__icon_extension
|
|
73
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_extension.png");
|
|
74
|
+
private static Texture __icon_googleplay = null;
|
|
75
|
+
public static Texture icon_googleplay =>
|
|
76
|
+
__icon_googleplay
|
|
77
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_googleplay.png");
|
|
78
|
+
private static Texture __icon_html5 = null;
|
|
79
|
+
public static Texture icon_html5 =>
|
|
80
|
+
__icon_html5 ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_html5.png");
|
|
81
|
+
private static Texture __icon_import = null;
|
|
82
|
+
public static Texture icon_import =>
|
|
83
|
+
__icon_import
|
|
84
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_import.png");
|
|
85
|
+
private static Texture __icon_ios = null;
|
|
86
|
+
public static Texture icon_ios =>
|
|
87
|
+
__icon_ios ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_ios.png");
|
|
88
|
+
private static Texture __icon_oppo = null;
|
|
89
|
+
public static Texture icon_oppo =>
|
|
90
|
+
__icon_oppo ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_oppo.png");
|
|
91
|
+
private static Texture __icon_refresh = null;
|
|
92
|
+
public static Texture icon_refresh =>
|
|
93
|
+
__icon_refresh
|
|
94
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_refresh.png");
|
|
95
|
+
private static Texture __icon_save = null;
|
|
96
|
+
public static Texture icon_save =>
|
|
97
|
+
__icon_save ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_save.png");
|
|
98
|
+
private static Texture __icon_success = null;
|
|
99
|
+
public static Texture icon_success =>
|
|
100
|
+
__icon_success
|
|
101
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_success.png");
|
|
102
|
+
private static Texture __icon_vivo = null;
|
|
103
|
+
public static Texture icon_vivo =>
|
|
104
|
+
__icon_vivo ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_vivo.png");
|
|
105
|
+
private static Texture __icon_wechat = null;
|
|
106
|
+
public static Texture icon_wechat =>
|
|
107
|
+
__icon_wechat
|
|
108
|
+
?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/icon_wechat.png");
|
|
109
|
+
private static Texture __tex_select = null;
|
|
110
|
+
public static Texture tex_select =>
|
|
111
|
+
__tex_select ?? AssetDatabase.LoadAssetAtPath<Texture>($"{FolderPath}/tex_select.png");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using System.IO;
|
|
5
|
+
using System.Text;
|
|
6
|
+
using UnityEditor;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace TyphoonUnitySDK
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// 模块导出
|
|
13
|
+
/// </summary>
|
|
14
|
+
public class ExportModule
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
/// 导出ChinaAndroid模块
|
|
18
|
+
/// </summary>
|
|
19
|
+
[MenuItem("TyphoonSDK/开发者/导出-ChinaAndroid")]
|
|
20
|
+
public static void ExportChinaAndroid()
|
|
21
|
+
{
|
|
22
|
+
var manifest = new List<string>()
|
|
23
|
+
{
|
|
24
|
+
"Assets/Plugins/Android/libs/sdk_plug-release.aar",
|
|
25
|
+
"Assets/Plugins/Android/libs/unity_app-release.aar",
|
|
26
|
+
"Assets/Plugins/Android/libs/unity_launcher-release.aar",
|
|
27
|
+
"Assets/Plugins/Android/AndroidManifest.xml",
|
|
28
|
+
"Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (!MakeSureExport(manifest))
|
|
32
|
+
{
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!CheckMissFiles(manifest))
|
|
37
|
+
{
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ExportManifestToModule(manifest, "ChinaAndroid");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
/// 导出清单文件到模块
|
|
47
|
+
/// </summary>
|
|
48
|
+
public static void ExportManifestToModule(List<string> manifest, string moduleName)
|
|
49
|
+
{
|
|
50
|
+
var metas = new List<string>();
|
|
51
|
+
//补充.meta文件
|
|
52
|
+
foreach (var element in manifest)
|
|
53
|
+
{
|
|
54
|
+
var meta = $"{element}.meta";
|
|
55
|
+
if (File.Exists(meta))
|
|
56
|
+
{
|
|
57
|
+
metas.Add(meta);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var export = new List<string>();
|
|
62
|
+
export.AddRange(manifest);
|
|
63
|
+
export.AddRange(metas);
|
|
64
|
+
Debug.Log($"导出文件数:" + export.Count);
|
|
65
|
+
var modulePath = $"{UniEditor.PathRoot}/Sources~/{moduleName}";
|
|
66
|
+
//备份
|
|
67
|
+
BackUp(modulePath);
|
|
68
|
+
//删除
|
|
69
|
+
if (Directory.Exists(modulePath))
|
|
70
|
+
{
|
|
71
|
+
Directory.Delete(modulePath, true);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Debug.Log($"导出到-->{modulePath}");
|
|
75
|
+
//复制文件
|
|
76
|
+
foreach (var element in export)
|
|
77
|
+
{
|
|
78
|
+
var to = $"{modulePath}/{element}";
|
|
79
|
+
CopyFileOrDir(element, to);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
Debug.Log($"导出完毕");
|
|
83
|
+
//打开文件夹
|
|
84
|
+
EditorUtility.RevealInFinder(modulePath);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/*询问是否导出*/
|
|
88
|
+
public static bool MakeSureExport(List<string> manifest)
|
|
89
|
+
{
|
|
90
|
+
var sb = new StringBuilder();
|
|
91
|
+
sb.AppendLine("导出资源?如下:");
|
|
92
|
+
foreach (var element in manifest)
|
|
93
|
+
{
|
|
94
|
+
sb.AppendLine(element);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return EditorUtility.DisplayDialog("提示", sb.ToString(), "是", "否");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/*检查是否缺少文件*/
|
|
101
|
+
public static bool CheckMissFiles(List<string> manifest, bool logError = true)
|
|
102
|
+
{
|
|
103
|
+
var miss = new List<string>();
|
|
104
|
+
var result = true;
|
|
105
|
+
foreach (var element in manifest)
|
|
106
|
+
{
|
|
107
|
+
if (!IsFileOrDirectoryExist(element))
|
|
108
|
+
{
|
|
109
|
+
miss.Add(element);
|
|
110
|
+
result = false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (logError)
|
|
115
|
+
{
|
|
116
|
+
foreach (var element in miss)
|
|
117
|
+
{
|
|
118
|
+
Debug.LogError($"缺少文件:{element}");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/*检查文件或文件夹是否存在*/
|
|
127
|
+
public static bool IsFileOrDirectoryExist(string path)
|
|
128
|
+
{
|
|
129
|
+
if (File.Exists(path))
|
|
130
|
+
{
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (Directory.Exists(path))
|
|
135
|
+
{
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/*备份文件夹*/
|
|
143
|
+
public static void BackUp(string folderRoot)
|
|
144
|
+
{
|
|
145
|
+
if (!Directory.Exists(folderRoot))
|
|
146
|
+
{
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
var toFolder =
|
|
151
|
+
$"_TyphoonBackUp/{Path.GetFileNameWithoutExtension(folderRoot)}-{DateTime.Now.ToString("yyyyMMddhhmmss")}";
|
|
152
|
+
Debug.Log($"备份{folderRoot}-->{toFolder}");
|
|
153
|
+
UniEditor.CopyFolder(folderRoot, toFolder);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/*复制文件或文件夹*/
|
|
157
|
+
public static void CopyFileOrDir(string source, string dest)
|
|
158
|
+
{
|
|
159
|
+
if (File.Exists(source))
|
|
160
|
+
{
|
|
161
|
+
var dir = Path.GetDirectoryName(dest);
|
|
162
|
+
if (!Directory.Exists(dir))
|
|
163
|
+
{
|
|
164
|
+
Directory.CreateDirectory(dir);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
File.Copy(source, dest, true);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (Directory.Exists(source))
|
|
172
|
+
{
|
|
173
|
+
UniEditor.CopyFolder(source, dest);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
[MenuItem("TyphoonSDK/开发者/导出-常用打包配置.unitypackage")]
|
|
180
|
+
public static void ExportUnityPackage()
|
|
181
|
+
{
|
|
182
|
+
var path = UniEditor.PackagePath_PublishSetting;
|
|
183
|
+
var backup =
|
|
184
|
+
$"_TyphoonBackUp/{Path.GetFileNameWithoutExtension(path)}-{DateTime.Now.ToString("yyyyMMddHHmmss")}{Path.GetExtension(path)}";
|
|
185
|
+
var dir = Path.GetDirectoryName(backup);
|
|
186
|
+
UniEditor.CreateDirIfNotExist(dir);
|
|
187
|
+
|
|
188
|
+
if (File.Exists(path))
|
|
189
|
+
{
|
|
190
|
+
Debug.Log($"备份:{path}-->{backup}");
|
|
191
|
+
File.Copy(path, backup, true);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
dir = Path.GetDirectoryName(path);
|
|
195
|
+
UniEditor.CreateDirIfNotExist(dir);
|
|
196
|
+
var guids = AssetDatabase.FindAssets($"t:{typeof(PublishSetting).FullName}",
|
|
197
|
+
new[] { "Assets/Typhoon_Gen/TyphoonSDK/Editor/常用打包配置" });
|
|
198
|
+
foreach (var guid in guids)
|
|
199
|
+
{
|
|
200
|
+
var assetPath = AssetDatabase.GUIDToAssetPath(guid);
|
|
201
|
+
var setting = AssetDatabase.LoadAssetAtPath<PublishSetting>(assetPath);
|
|
202
|
+
EditorUtility.SetDirty(setting);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
Debug.Log($"导出项:{guids.Length}");
|
|
206
|
+
AssetDatabase.SaveAssets();
|
|
207
|
+
//Assets/Typhoon_Gen/TyphoonSDK/Editor/常用打包配置
|
|
208
|
+
AssetDatabase.ExportPackage("Assets/Typhoon_Gen/TyphoonSDK/Editor/常用打包配置", path, ExportPackageOptions.Recurse);
|
|
209
|
+
AssetDatabase.Refresh();
|
|
210
|
+
if (File.Exists(path))
|
|
211
|
+
{
|
|
212
|
+
Debug.Log("导出成功");
|
|
213
|
+
EditorUtility.RevealInFinder(path);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
}
|