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,43 @@
|
|
|
1
|
+
using System.IO;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// 偏好设置
|
|
9
|
+
/// </summary>
|
|
10
|
+
public partial class Preferences : ScriptableObject
|
|
11
|
+
{
|
|
12
|
+
public static string AssetPath = "Assets/Typhoon_Gen/TyphoonSDK/Editor/Preferences.asset";
|
|
13
|
+
|
|
14
|
+
private static Preferences _instance = null;
|
|
15
|
+
|
|
16
|
+
public static Preferences Default
|
|
17
|
+
{
|
|
18
|
+
get
|
|
19
|
+
{
|
|
20
|
+
if (_instance == null)
|
|
21
|
+
{
|
|
22
|
+
_instance = AssetDatabase.LoadAssetAtPath<Preferences>(AssetPath);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (_instance == null)
|
|
26
|
+
{
|
|
27
|
+
_instance = CreateInstance<Preferences>();
|
|
28
|
+
UniEditor.CreateDirIfNotExist(Path.GetDirectoryName(AssetPath));
|
|
29
|
+
AssetDatabase.CreateAsset(_instance, AssetPath);
|
|
30
|
+
UniEditor.LogInfo($"生成:{AssetPath}");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return _instance;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[Header("检查拓展Addressable开关")]
|
|
38
|
+
/*检查Addressable Plug安装*/
|
|
39
|
+
public bool CheckInstallAddressablePlug = true;
|
|
40
|
+
|
|
41
|
+
[Header("gradle目录")] public string GradlePath = string.Empty;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
using Object = UnityEngine.Object;
|
|
7
|
+
|
|
8
|
+
namespace TyphoonUnitySDK
|
|
9
|
+
{
|
|
10
|
+
public class PreferencesWindow : StyleEditorWindow
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// 绑定重绘逻辑
|
|
14
|
+
/// </summary>
|
|
15
|
+
public static Dictionary<string, Func<Preferences, bool>> RedrawBinding =
|
|
16
|
+
new Dictionary<string, Func<Preferences, bool>>()
|
|
17
|
+
{
|
|
18
|
+
{ "m_Script", (s) => true },
|
|
19
|
+
{ nameof(Preferences.GradlePath), DrawProperty_GradlePath },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
[MenuItem("TyphoonSDK/选项", priority = 10000)]
|
|
24
|
+
public static void Open()
|
|
25
|
+
{
|
|
26
|
+
var win = GetWindow<PreferencesWindow>();
|
|
27
|
+
win.titleContent = new GUIContent("选项");
|
|
28
|
+
win.minSize = new Vector2(650, 500);
|
|
29
|
+
win.Show();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private Editor _editor;
|
|
33
|
+
|
|
34
|
+
public Editor Editor
|
|
35
|
+
{
|
|
36
|
+
get
|
|
37
|
+
{
|
|
38
|
+
if (_editor != null && _editor.target != Preferences.Default)
|
|
39
|
+
{
|
|
40
|
+
DestroyImmediate(_editor);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (_editor == null)
|
|
44
|
+
{
|
|
45
|
+
_editor = Editor.CreateEditor(Preferences.Default);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return _editor;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
protected override void OnDrawGUI()
|
|
54
|
+
{
|
|
55
|
+
base.OnDrawGUI();
|
|
56
|
+
var rect = new Rect(0, 0, position.width, position.height);
|
|
57
|
+
var area = rect;
|
|
58
|
+
area.height -= 8;
|
|
59
|
+
area.width -= 12;
|
|
60
|
+
area.center = rect.center;
|
|
61
|
+
GUILayout.BeginArea(area);
|
|
62
|
+
var rectSave = new Rect(0, 0, area.width, area.height);
|
|
63
|
+
rectSave.width = 100;
|
|
64
|
+
rectSave.height = 32;
|
|
65
|
+
rectSave.x = area.width - rectSave.width;
|
|
66
|
+
rectSave.x -= 4;
|
|
67
|
+
rectSave.y += 4;
|
|
68
|
+
if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save), Styles.rbutton_green))
|
|
69
|
+
{
|
|
70
|
+
EditorUtility.SetDirty(Preferences.Default);
|
|
71
|
+
AssetDatabase.SaveAssets();
|
|
72
|
+
Debug.Log("保存完毕");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
DrawPropertyGUI(Preferences.Default);
|
|
76
|
+
GUILayout.EndArea();
|
|
77
|
+
Repaint();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/*绘制GUI*/
|
|
82
|
+
public static void DrawPropertyGUI(Preferences preferences)
|
|
83
|
+
{
|
|
84
|
+
DrawProperty(preferences, (property) =>
|
|
85
|
+
{
|
|
86
|
+
if (RedrawBinding.TryGetValue(property, out var match))
|
|
87
|
+
{
|
|
88
|
+
return match.Invoke(preferences);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return false;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/*绘制属性*/
|
|
97
|
+
public static void DrawProperty(Object target, Func<string, bool> ignoreFunc)
|
|
98
|
+
{
|
|
99
|
+
var obj = new SerializedObject(target);
|
|
100
|
+
EditorGUI.BeginChangeCheck();
|
|
101
|
+
obj.UpdateIfRequiredOrScript();
|
|
102
|
+
SerializedProperty iterator = obj.GetIterator();
|
|
103
|
+
for (var enterChildren = true; iterator.NextVisible(enterChildren); enterChildren = false)
|
|
104
|
+
{
|
|
105
|
+
using (new EditorGUI.DisabledScope("m_Script" == iterator.propertyPath))
|
|
106
|
+
{
|
|
107
|
+
var cover = ignoreFunc.Invoke(iterator.propertyPath);
|
|
108
|
+
if (!cover)
|
|
109
|
+
{
|
|
110
|
+
EditorGUILayout.PropertyField(iterator, true);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
obj.ApplyModifiedProperties();
|
|
116
|
+
EditorGUI.EndChangeCheck();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
private static bool DrawProperty_GradlePath(Preferences preferences)
|
|
121
|
+
{
|
|
122
|
+
GUILayout.Space(10);
|
|
123
|
+
var error = false;
|
|
124
|
+
var color = GUI.color;
|
|
125
|
+
if (!UniEditor.GradleIsMatch())
|
|
126
|
+
{
|
|
127
|
+
GUILayout.Label(new GUIContent("未配置gradle路径", EditorIcons.icon_error), Styles.ToolbarBoldLabel,
|
|
128
|
+
GUILayout.Height(24));
|
|
129
|
+
color = GUI.color;
|
|
130
|
+
GUI.color = Color.green;
|
|
131
|
+
GUILayout.TextArea(
|
|
132
|
+
"目录选到bin的文件夹即可\n例如:C:\\Users\\Jan\\.gradle\\wrapper\\dists\\gradle-6.8-bin\\1jblhjyydfkclfzx1agp92nyl\\gradle-6.8\\bin");
|
|
133
|
+
GUI.color = color;
|
|
134
|
+
error = true;
|
|
135
|
+
}
|
|
136
|
+
else
|
|
137
|
+
{
|
|
138
|
+
GUILayout.Label(new GUIContent("gradle路径", EditorIcons.icon_success), Styles.ToolbarBoldLabel,
|
|
139
|
+
GUILayout.Height(24));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
GUILayout.BeginHorizontal();
|
|
143
|
+
GUILayout.Label("目录:", Styles.ToolbarBoldLabel, GUILayout.Width(40));
|
|
144
|
+
color = GUI.color;
|
|
145
|
+
GUI.color = error ? Color.red : color;
|
|
146
|
+
preferences.GradlePath = GUILayout.TextArea(preferences.GradlePath, GUILayout.Height(44));
|
|
147
|
+
GUI.color = color;
|
|
148
|
+
if (GUILayout.Button("选择", GUILayout.Width(60)))
|
|
149
|
+
{
|
|
150
|
+
// 获取当前用户的 Windows 用户文件夹路径
|
|
151
|
+
var userFolder = UniEditor.GetWindowUserFolder();
|
|
152
|
+
var fastPath = "";
|
|
153
|
+
if (Directory.Exists(userFolder))
|
|
154
|
+
{
|
|
155
|
+
var maybe = $"{userFolder}/.gradle/wrapper/dists";
|
|
156
|
+
if (Directory.Exists(maybe))
|
|
157
|
+
{
|
|
158
|
+
fastPath = maybe;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
var select = EditorUtility.OpenFolderPanel("请选择Gradle目录", fastPath, "");
|
|
163
|
+
preferences.GradlePath = select;
|
|
164
|
+
EditorUtility.SetDirty(preferences);
|
|
165
|
+
var check = $"{select}/gradle";
|
|
166
|
+
if (!File.Exists(check))
|
|
167
|
+
{
|
|
168
|
+
UniEditor.ShowMessageBox($"gardle目录不匹配,找不到:{check}", null);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
GUI.FocusControl("");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
GUILayout.EndHorizontal();
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
using System.Collections;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// 发布结果
|
|
9
|
+
/// </summary>
|
|
10
|
+
public class PublishResult
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// 导出的android工程
|
|
14
|
+
/// </summary>
|
|
15
|
+
public string AndroidProj;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEditor;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.Rendering;
|
|
6
|
+
using UnityEngine.Serialization;
|
|
7
|
+
|
|
8
|
+
namespace TyphoonUnitySDK
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// aa 参数修改
|
|
12
|
+
/// </summary>
|
|
13
|
+
[Serializable]
|
|
14
|
+
public class AddressableVariableModify
|
|
15
|
+
{
|
|
16
|
+
public string VariableName;
|
|
17
|
+
public string VariableValue;
|
|
18
|
+
|
|
19
|
+
public AddressableVariableModify(string variableName, string variableValue)
|
|
20
|
+
{
|
|
21
|
+
VariableName = variableName;
|
|
22
|
+
VariableValue = variableValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
/// webgl 模板
|
|
28
|
+
/// </summary>
|
|
29
|
+
public enum WebGlTemplate
|
|
30
|
+
{
|
|
31
|
+
Default,
|
|
32
|
+
Minimal,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
/// 发布设置
|
|
38
|
+
/// </summary>
|
|
39
|
+
[CreateAssetMenu]
|
|
40
|
+
public class PublishSetting : ScriptableObject
|
|
41
|
+
{
|
|
42
|
+
[Header("基础")] public BuildTarget BuildTarget;
|
|
43
|
+
|
|
44
|
+
public GraphicsDeviceType[] GraphicsAPIs;
|
|
45
|
+
public ScriptingImplementation ScriptingImplementation = ScriptingImplementation.IL2CPP;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
public bool StripEngineCode = false;
|
|
49
|
+
|
|
50
|
+
public ManagedStrippingLevel StrippingLevel = ManagedStrippingLevel.Disabled;
|
|
51
|
+
|
|
52
|
+
#if UNITY_2021
|
|
53
|
+
public AndroidSdkVersions MinApiVersion = AndroidSdkVersions.AndroidApiLevel22;
|
|
54
|
+
#else
|
|
55
|
+
public AndroidSdkVersions MinApiVersion = AndroidSdkVersions.AndroidApiLevel19;
|
|
56
|
+
#endif
|
|
57
|
+
public AndroidSdkVersions TargetApiVersion = AndroidSdkVersions.AndroidApiLevelAuto;
|
|
58
|
+
public bool ArmV7 = true;
|
|
59
|
+
public bool ArmV64 = true;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
[Header("渠道包名信息")] public AppChannel Channel = AppChannel.Test;
|
|
63
|
+
public PublishProcess PublishProcess = PublishProcess.Apk;
|
|
64
|
+
public string PackageName = "com.rgame.app";
|
|
65
|
+
public string VersionString = "1.0.0";
|
|
66
|
+
public VersionType VersionType = VersionType.Release;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
[Header("签名")] public bool EnableSignature = false;
|
|
70
|
+
public string KeystoreName;
|
|
71
|
+
public string KeystorePassword;
|
|
72
|
+
public string KeyAliasName;
|
|
73
|
+
public string KeyAliasPassword;
|
|
74
|
+
|
|
75
|
+
[Header("Webgl")] public bool OverrideWebglTemplate = false;
|
|
76
|
+
public WebGlTemplate WebglTemplate = WebGlTemplate.Minimal;
|
|
77
|
+
public bool OverrideWebglCompressionFormat = false;
|
|
78
|
+
public WebGLCompressionFormat CompressionFormat = WebGLCompressionFormat.Gzip;
|
|
79
|
+
|
|
80
|
+
[FormerlySerializedAs("EnableAASupport")] [FormerlySerializedAs("EnableAddressableSupport")] [Header("AA相关")]
|
|
81
|
+
/*AA相关*/
|
|
82
|
+
public bool AASupportEnable = false;
|
|
83
|
+
|
|
84
|
+
[FormerlySerializedAs("AddressableUseProfile")]
|
|
85
|
+
public string AAUseProfile = "";
|
|
86
|
+
|
|
87
|
+
public List<AddressableVariableModify> AAVariableModify = new List<AddressableVariableModify>();
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
//使用配置
|
|
91
|
+
public virtual void Apply()
|
|
92
|
+
{
|
|
93
|
+
ApplyTool.Apply(this);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
//发布
|
|
98
|
+
public virtual void Publish()
|
|
99
|
+
{
|
|
100
|
+
PublishTool.Publish(this);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// <summary>
|
|
104
|
+
/// 是否支持AA
|
|
105
|
+
/// </summary>
|
|
106
|
+
public bool IsAACanBeSetting()
|
|
107
|
+
{
|
|
108
|
+
return UniEditor.HasAddressableSupport() & AASupportEnable;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|