com.typhoon.unitysdk 1.0.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Editor/ApplyTool.cs +6 -6
- package/Editor/ExportModule.cs +21 -0
- package/Editor/Preferences.cs +5 -8
- package/Editor/PreferencesWindow.cs +22 -25
- package/Editor/PublishVivoBatSetting.cs +3 -0
- package/Editor/PublishVivoBatSettingInspector.cs +1 -1
- package/Editor/PublishVivoBatSettingWindow.cs +2 -2
- package/Editor/PublishWindow.cs +8 -5
- package/Editor/UniEditor.cs +35 -13
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK.png +0 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK.png.meta +96 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK_ALPHA.png +0 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_BLACK_ALPHA.png.meta +144 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_GREEN_ALPHA.png +0 -0
- package/Runtime/Resources/TYPHOON_TEXTURE_TOAST_GREEN_ALPHA.png.meta +144 -0
- package/Runtime/SimulateRecordGame.cs +2 -126
- package/Runtime/UnityGUIMessageBox.cs +132 -0
- package/{Editor/InstallModule.cs.meta → Runtime/UnityGUIMessageBox.cs.meta} +1 -1
- package/Runtime/ximaiti.otf +0 -0
- package/Runtime/ximaiti.otf.meta +21 -0
- package/Sources~/Package/Douyin.unitypackage +0 -0
- package/Sources~/Package/Toast.unitypackage +0 -0
- package/Sources~/Package/Toast.unitypackage.manifest +11 -0
- package/package.json +1 -1
- package/Editor/InstallModule.cs +0 -38
package/Editor/ApplyTool.cs
CHANGED
|
@@ -46,19 +46,19 @@ namespace TyphoonUnitySDK
|
|
|
46
46
|
case BuildTarget.Android:
|
|
47
47
|
{
|
|
48
48
|
ModifyAndroidPlayerSetting(setting);
|
|
49
|
-
|
|
49
|
+
Debug.Log($"<color=#3ac9f3>根据发布模式导入更换资源包</color>");
|
|
50
50
|
}
|
|
51
51
|
break;
|
|
52
52
|
case BuildTarget.iOS:
|
|
53
53
|
{
|
|
54
54
|
ModifyIOSSetting(setting);
|
|
55
|
-
|
|
55
|
+
Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
|
|
56
56
|
}
|
|
57
57
|
break;
|
|
58
58
|
case BuildTarget.WebGL:
|
|
59
59
|
{
|
|
60
60
|
ModifyWebglSetting(setting);
|
|
61
|
-
|
|
61
|
+
Debug.Log($"<color=#3ac9f3>//TODO//根据发布模式导入更换资源包</color>");
|
|
62
62
|
}
|
|
63
63
|
break;
|
|
64
64
|
default:
|
|
@@ -142,7 +142,7 @@ namespace TyphoonUnitySDK
|
|
|
142
142
|
AddressableSupport.ModifyAAProfileAndVariables(setting);
|
|
143
143
|
//写入App config
|
|
144
144
|
WriteAppConfig(setting);
|
|
145
|
-
|
|
145
|
+
Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/// <summary>
|
|
@@ -157,7 +157,7 @@ namespace TyphoonUnitySDK
|
|
|
157
157
|
AddressableSupport.ModifyAAProfileAndVariables(setting);
|
|
158
158
|
//写入App config
|
|
159
159
|
WriteAppConfig(setting);
|
|
160
|
-
|
|
160
|
+
Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/// <summary>
|
|
@@ -196,7 +196,7 @@ namespace TyphoonUnitySDK
|
|
|
196
196
|
AddressableSupport.ModifyAAProfileAndVariables(setting);
|
|
197
197
|
//写入App config
|
|
198
198
|
WriteAppConfig(setting);
|
|
199
|
-
|
|
199
|
+
Debug.Log($"<color=#3ac9f3>//TODO//导入资源包...</color>");
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/// <summary>
|
package/Editor/ExportModule.cs
CHANGED
|
@@ -255,6 +255,27 @@ namespace TyphoonUnitySDK
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
|
|
258
|
+
[MenuItem("TyphoonSDK/开发者/导出-Toast.unitypackage")]
|
|
259
|
+
public static void ExportToastModule()
|
|
260
|
+
{
|
|
261
|
+
var manifest = new List<string>()
|
|
262
|
+
{
|
|
263
|
+
"Assets/Typhoon_Gen/TyphoonSDK/Toast",
|
|
264
|
+
};
|
|
265
|
+
if (!MakeSureExport(manifest))
|
|
266
|
+
{
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (!CheckMissFiles(manifest))
|
|
271
|
+
{
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
ExportUnityPackage(manifest, UniEditor.PackagePath_Toast, out var detail);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
|
|
258
279
|
/// <summary>
|
|
259
280
|
/// 导出UnityPackage
|
|
260
281
|
/// </summary>
|
package/Editor/Preferences.cs
CHANGED
|
@@ -27,20 +27,17 @@ namespace TyphoonUnitySDK
|
|
|
27
27
|
_instance = CreateInstance<Preferences>();
|
|
28
28
|
UniEditor.CreateDirIfNotExist(Path.GetDirectoryName(AssetPath));
|
|
29
29
|
AssetDatabase.CreateAsset(_instance, AssetPath);
|
|
30
|
-
|
|
30
|
+
Debug.Log($"<color=#3ac9f3>生成:{AssetPath}</color>");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
return _instance;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
|
|
38
|
+
public bool CheckAddressableSupport = true;
|
|
39
|
+
|
|
40
|
+
|
|
41
41
|
[Header("gradle目录")] public string GradlePath = string.Empty;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
42
|
}
|
|
46
43
|
}
|
|
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|
|
3
3
|
using System.IO;
|
|
4
4
|
using UnityEditor;
|
|
5
5
|
using UnityEngine;
|
|
6
|
-
using Object = UnityEngine.Object;
|
|
7
6
|
|
|
8
7
|
namespace TyphoonUnitySDK
|
|
9
8
|
{
|
|
@@ -58,21 +57,8 @@ namespace TyphoonUnitySDK
|
|
|
58
57
|
area.x += 4;
|
|
59
58
|
area.height = rect.yMax - area.yMin - 4;
|
|
60
59
|
GUILayout.BeginArea(area);
|
|
61
|
-
|
|
62
60
|
_scroll = GUILayout.BeginScrollView(_scroll);
|
|
63
|
-
|
|
64
|
-
if (_preferenceFoldout)
|
|
65
|
-
{
|
|
66
|
-
DrawPreferencesPropertyGUI(Preferences.Default);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
GUILayout.Space(10);
|
|
70
|
-
_wxMiniConfigFoldout = GUIDrawer.DrawFoldout("微信小游戏", _wxMiniConfigFoldout, GUILayout.Height(26));
|
|
71
|
-
if (_wxMiniConfigFoldout)
|
|
72
|
-
{
|
|
73
|
-
WxMiniConfigGUIDrawer.DrawWxMiniConfig();
|
|
74
|
-
}
|
|
75
|
-
|
|
61
|
+
DrawPreferencesPropertyGUI(Preferences.Default);
|
|
76
62
|
GUILayout.EndScrollView();
|
|
77
63
|
GUILayout.EndArea();
|
|
78
64
|
Repaint();
|
|
@@ -84,11 +70,29 @@ namespace TyphoonUnitySDK
|
|
|
84
70
|
public static Dictionary<string, Func<Preferences, bool>> OverrideDrawGUIPreferences =
|
|
85
71
|
new Dictionary<string, Func<Preferences, bool>>()
|
|
86
72
|
{
|
|
87
|
-
{ "m_Script",
|
|
88
|
-
{ nameof(Preferences.
|
|
73
|
+
{ "m_Script", DrawProperty_mScript },
|
|
74
|
+
{ nameof(Preferences.CheckAddressableSupport), DrawProperty_CheckAddressableSupport },
|
|
89
75
|
{ nameof(Preferences.GradlePath), DrawProperty_GradlePath },
|
|
90
76
|
};
|
|
91
77
|
|
|
78
|
+
private static bool DrawProperty_CheckAddressableSupport(Preferences arg)
|
|
79
|
+
{
|
|
80
|
+
GUILayout.Space(10);
|
|
81
|
+
Preferences.Default.CheckAddressableSupport =
|
|
82
|
+
GUILayout.Toggle(Preferences.Default.CheckAddressableSupport, "检查Addressable支持");
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private static bool DrawProperty_mScript(Preferences arg)
|
|
87
|
+
{
|
|
88
|
+
var temEnable = GUI.enabled;
|
|
89
|
+
GUI.enabled = true;
|
|
90
|
+
GUIDrawer.DrawKeynotes("使用须知:");
|
|
91
|
+
GUIDrawer.DrawKeynotes("①工具对Addressable有支持,从菜单:'TyphoonSDK/安装拓展...' 中导入");
|
|
92
|
+
GUI.enabled = temEnable;
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
92
96
|
|
|
93
97
|
/*绘制GUI*/
|
|
94
98
|
public static void DrawPreferencesPropertyGUI(Preferences preferences)
|
|
@@ -104,16 +108,9 @@ namespace TyphoonUnitySDK
|
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
private static bool DrawProperty_CheckInstallAddressablePlug(Preferences arg)
|
|
108
|
-
{
|
|
109
|
-
arg.CheckInstallAddressablePlug =
|
|
110
|
-
GUILayout.Toggle(arg.CheckInstallAddressablePlug, "自动检查Addressabled Supoort");
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
111
|
private static bool DrawProperty_GradlePath(Preferences preferences)
|
|
116
112
|
{
|
|
113
|
+
GUILayout.Space(5);
|
|
117
114
|
if (!UniEditor.GradleIsMatch())
|
|
118
115
|
{
|
|
119
116
|
GUILayout.BeginHorizontal();
|
|
@@ -13,9 +13,11 @@ namespace TyphoonUnitySDK
|
|
|
13
13
|
public string GameName;
|
|
14
14
|
public Texture Icon;
|
|
15
15
|
public string PackageName;
|
|
16
|
+
public int TargetSdkVersion = 32;
|
|
16
17
|
public string AppId;
|
|
17
18
|
public string PrivacyPolicyYNoteUrl;
|
|
18
19
|
|
|
20
|
+
|
|
19
21
|
[Header("签名相关")] public string KeystoreName;
|
|
20
22
|
public string KeystorePassword;
|
|
21
23
|
public string KeyAliasName;
|
|
@@ -36,6 +38,7 @@ namespace TyphoonUnitySDK
|
|
|
36
38
|
public int VersionCode = 1000000;
|
|
37
39
|
private static string PATH = "Assets/Editor/PublishVivoBatSetting.asset";
|
|
38
40
|
|
|
41
|
+
|
|
39
42
|
public static PublishVivoBatSetting _default = null;
|
|
40
43
|
|
|
41
44
|
public static PublishVivoBatSetting Default
|
|
@@ -36,7 +36,7 @@ namespace TyphoonUnitySDK
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
protected
|
|
39
|
+
protected void OnGUI()
|
|
40
40
|
{
|
|
41
41
|
var rect = new Rect(0, 0, position.width, position.height);
|
|
42
42
|
var area = rect;
|
|
@@ -51,7 +51,7 @@ namespace TyphoonUnitySDK
|
|
|
51
51
|
rectSave.x -= 4;
|
|
52
52
|
GUILayout.Space(36);
|
|
53
53
|
Editor.OnInspectorGUI();
|
|
54
|
-
if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save)
|
|
54
|
+
if (GUI.Button(rectSave, new GUIContent("保存配置", EditorIcons.icon_save)))
|
|
55
55
|
{
|
|
56
56
|
EditorUtility.SetDirty(PublishVivoBatSetting.Default);
|
|
57
57
|
AssetDatabase.SaveAssets();
|
package/Editor/PublishWindow.cs
CHANGED
|
@@ -85,6 +85,9 @@ namespace TyphoonUnitySDK
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
//检查一些事情
|
|
90
|
+
UniEditor.CheckSomethingsOnPublishWindowShow();
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
protected void OnGUI()
|
|
@@ -348,21 +351,21 @@ namespace TyphoonUnitySDK
|
|
|
348
351
|
|
|
349
352
|
if (clickApply)
|
|
350
353
|
{
|
|
351
|
-
|
|
354
|
+
Debug.Log($"<color=#3ac9f3>应用...{_select}</color>");
|
|
352
355
|
_select.Apply();
|
|
353
|
-
|
|
356
|
+
Debug.Log($"<color=#3ac9f3>应用完毕</color>");
|
|
354
357
|
}
|
|
355
358
|
|
|
356
359
|
if (clickBuildAA)
|
|
357
360
|
{
|
|
358
|
-
|
|
361
|
+
Debug.Log($"<color=#3ac9f3>构建AA...</color>");
|
|
359
362
|
AddressableSupport.BuildAASource(_select);
|
|
360
|
-
|
|
363
|
+
Debug.Log($"<color=#3ac9f3>构建AA结束</color>");
|
|
361
364
|
}
|
|
362
365
|
|
|
363
366
|
if (clickPublish)
|
|
364
367
|
{
|
|
365
|
-
|
|
368
|
+
Debug.Log($"<color=#3ac9f3>发布...</color>");
|
|
366
369
|
_select.Publish();
|
|
367
370
|
}
|
|
368
371
|
|
package/Editor/UniEditor.cs
CHANGED
|
@@ -5,7 +5,6 @@ using System.Linq;
|
|
|
5
5
|
using System.Text;
|
|
6
6
|
using UnityEditor;
|
|
7
7
|
using UnityEngine;
|
|
8
|
-
using Object = UnityEngine.Object;
|
|
9
8
|
|
|
10
9
|
namespace TyphoonUnitySDK
|
|
11
10
|
{
|
|
@@ -40,6 +39,12 @@ namespace TyphoonUnitySDK
|
|
|
40
39
|
public static string PackagePath_Douyin = $"{PathRoot}/Sources~/Package/Douyin.unitypackage";
|
|
41
40
|
|
|
42
41
|
|
|
42
|
+
/// <summary>
|
|
43
|
+
/// Toast模块
|
|
44
|
+
/// </summary>
|
|
45
|
+
public static string PackagePath_Toast = $"{PathRoot}/Sources~/Package/Toast.unitypackage";
|
|
46
|
+
|
|
47
|
+
|
|
43
48
|
/// <summary>
|
|
44
49
|
/// 开启Addressable模块支持
|
|
45
50
|
/// </summary>
|
|
@@ -84,17 +89,17 @@ namespace TyphoonUnitySDK
|
|
|
84
89
|
/// </summary>
|
|
85
90
|
public static void ImportPackage(string path, bool interactive = true)
|
|
86
91
|
{
|
|
87
|
-
|
|
92
|
+
Debug.Log($"<color=#3ac9f3>导入----{path}</color>");
|
|
88
93
|
AssetDatabase.ImportPackage(path, interactive);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
/// <summary>
|
|
92
|
-
/// 日志输出
|
|
93
|
-
/// </summary>
|
|
94
|
-
public static void LogInfo(string content)
|
|
95
|
-
{
|
|
96
|
-
|
|
97
|
-
}
|
|
96
|
+
// /// <summary>
|
|
97
|
+
// /// 日志输出
|
|
98
|
+
// /// </summary>
|
|
99
|
+
// public static void LogInfo(string content)
|
|
100
|
+
// {
|
|
101
|
+
// Debug.Log($"<color=#3ac9f3>{content}</color>");
|
|
102
|
+
// }
|
|
98
103
|
|
|
99
104
|
/// <summary>
|
|
100
105
|
/// 清理宏定义
|
|
@@ -230,7 +235,6 @@ namespace TyphoonUnitySDK
|
|
|
230
235
|
return result;
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
|
|
234
238
|
/// <summary>
|
|
235
239
|
/// 是否安装了Addressable
|
|
236
240
|
/// </summary>
|
|
@@ -251,18 +255,19 @@ namespace TyphoonUnitySDK
|
|
|
251
255
|
}
|
|
252
256
|
|
|
253
257
|
|
|
254
|
-
[MenuItem("TyphoonSDK
|
|
258
|
+
[MenuItem("TyphoonSDK/安装拓展/Addressable 支持", priority = 100)]
|
|
255
259
|
public static void InstallAddressableSupport()
|
|
256
260
|
{
|
|
257
261
|
AppendScriptingDefineSymbol(DEFINE_TYPHOON_ADDRESSABLE_NAME);
|
|
258
262
|
AssetDatabase.Refresh();
|
|
259
263
|
AssetDatabase.SaveAssets();
|
|
264
|
+
Debug.Log("Addressable 支持,安装成功!");
|
|
260
265
|
}
|
|
261
266
|
|
|
262
|
-
[MenuItem("TyphoonSDK
|
|
267
|
+
[MenuItem("TyphoonSDK/安装拓展/Addressable 支持", true)]
|
|
263
268
|
public static bool InstallAddressableSupportValid()
|
|
264
269
|
{
|
|
265
|
-
return HasAddressable();
|
|
270
|
+
return HasAddressable() && !HasAddressableSupport();
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
[MenuItem("TyphoonSDK/卸载/Addressable 支持", priority = 100)]
|
|
@@ -273,6 +278,7 @@ namespace TyphoonUnitySDK
|
|
|
273
278
|
ClearScriptingDefineSymbol(DEFINE_TYPHOON_ADDRESSABLE_NAME);
|
|
274
279
|
AssetDatabase.Refresh();
|
|
275
280
|
AssetDatabase.SaveAssets();
|
|
281
|
+
Debug.Log("Addressable 支持,卸载完毕!");
|
|
276
282
|
});
|
|
277
283
|
}
|
|
278
284
|
|
|
@@ -285,6 +291,12 @@ namespace TyphoonUnitySDK
|
|
|
285
291
|
return false;
|
|
286
292
|
}
|
|
287
293
|
|
|
294
|
+
[MenuItem("TyphoonSDK/安装拓展/Toast模块", priority = 100)]
|
|
295
|
+
public static void InstallToast()
|
|
296
|
+
{
|
|
297
|
+
AssetDatabase.ImportPackage(UniEditor.PackagePath_Toast, true);
|
|
298
|
+
}
|
|
299
|
+
|
|
288
300
|
|
|
289
301
|
/// <summary>
|
|
290
302
|
/// 弹出二次提示窗口
|
|
@@ -515,5 +527,15 @@ namespace TyphoonUnitySDK
|
|
|
515
527
|
|
|
516
528
|
File.WriteAllText(path, sb.ToString());
|
|
517
529
|
}
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
/*发布窗口打开时触发一些事情*/
|
|
533
|
+
public static void CheckSomethingsOnPublishWindowShow()
|
|
534
|
+
{
|
|
535
|
+
if (Preferences.Default.CheckAddressableSupport && HasAddressable() && !HasAddressableSupport())
|
|
536
|
+
{
|
|
537
|
+
ShowMessageBox("检查到Addressable,是否添加拓展[Addressable支持],可从选项中关闭", InstallAddressableSupport);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
518
540
|
}
|
|
519
541
|
}
|
|
Binary file
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: d8f62bc650e259a42b06cf4c7f1c8aef
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 11
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 1
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
isReadable: 0
|
|
24
|
+
streamingMipmaps: 0
|
|
25
|
+
streamingMipmapsPriority: 0
|
|
26
|
+
vTOnly: 0
|
|
27
|
+
grayScaleToAlpha: 0
|
|
28
|
+
generateCubemap: 6
|
|
29
|
+
cubemapConvolution: 0
|
|
30
|
+
seamlessCubemap: 0
|
|
31
|
+
textureFormat: 1
|
|
32
|
+
maxTextureSize: 2048
|
|
33
|
+
textureSettings:
|
|
34
|
+
serializedVersion: 2
|
|
35
|
+
filterMode: 1
|
|
36
|
+
aniso: 1
|
|
37
|
+
mipBias: 0
|
|
38
|
+
wrapU: 0
|
|
39
|
+
wrapV: 0
|
|
40
|
+
wrapW: 0
|
|
41
|
+
nPOTScale: 1
|
|
42
|
+
lightmap: 0
|
|
43
|
+
compressionQuality: 50
|
|
44
|
+
spriteMode: 0
|
|
45
|
+
spriteExtrude: 1
|
|
46
|
+
spriteMeshType: 1
|
|
47
|
+
alignment: 0
|
|
48
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
49
|
+
spritePixelsToUnits: 100
|
|
50
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
51
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
52
|
+
alphaUsage: 1
|
|
53
|
+
alphaIsTransparency: 0
|
|
54
|
+
spriteTessellationDetail: -1
|
|
55
|
+
textureType: 0
|
|
56
|
+
textureShape: 1
|
|
57
|
+
singleChannelComponent: 0
|
|
58
|
+
flipbookRows: 1
|
|
59
|
+
flipbookColumns: 1
|
|
60
|
+
maxTextureSizeSet: 0
|
|
61
|
+
compressionQualitySet: 0
|
|
62
|
+
textureFormatSet: 0
|
|
63
|
+
ignorePngGamma: 0
|
|
64
|
+
applyGammaDecoding: 0
|
|
65
|
+
platformSettings:
|
|
66
|
+
- serializedVersion: 3
|
|
67
|
+
buildTarget: DefaultTexturePlatform
|
|
68
|
+
maxTextureSize: 2048
|
|
69
|
+
resizeAlgorithm: 0
|
|
70
|
+
textureFormat: -1
|
|
71
|
+
textureCompression: 1
|
|
72
|
+
compressionQuality: 50
|
|
73
|
+
crunchedCompression: 0
|
|
74
|
+
allowsAlphaSplitting: 0
|
|
75
|
+
overridden: 0
|
|
76
|
+
androidETC2FallbackOverride: 0
|
|
77
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
78
|
+
spriteSheet:
|
|
79
|
+
serializedVersion: 2
|
|
80
|
+
sprites: []
|
|
81
|
+
outline: []
|
|
82
|
+
physicsShape: []
|
|
83
|
+
bones: []
|
|
84
|
+
spriteID:
|
|
85
|
+
internalID: 0
|
|
86
|
+
vertices: []
|
|
87
|
+
indices:
|
|
88
|
+
edges: []
|
|
89
|
+
weights: []
|
|
90
|
+
secondaryTextures: []
|
|
91
|
+
spritePackingTag:
|
|
92
|
+
pSDRemoveMatte: 0
|
|
93
|
+
pSDShowRemoveMatteOption: 0
|
|
94
|
+
userData:
|
|
95
|
+
assetBundleName:
|
|
96
|
+
assetBundleVariant:
|
|
Binary file
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e707b1f4d89ec074fa368d77d9b21f14
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 11
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 1
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
isReadable: 0
|
|
24
|
+
streamingMipmaps: 0
|
|
25
|
+
streamingMipmapsPriority: 0
|
|
26
|
+
vTOnly: 0
|
|
27
|
+
grayScaleToAlpha: 0
|
|
28
|
+
generateCubemap: 6
|
|
29
|
+
cubemapConvolution: 0
|
|
30
|
+
seamlessCubemap: 0
|
|
31
|
+
textureFormat: 1
|
|
32
|
+
maxTextureSize: 2048
|
|
33
|
+
textureSettings:
|
|
34
|
+
serializedVersion: 2
|
|
35
|
+
filterMode: 1
|
|
36
|
+
aniso: 1
|
|
37
|
+
mipBias: 0
|
|
38
|
+
wrapU: 0
|
|
39
|
+
wrapV: 0
|
|
40
|
+
wrapW: 0
|
|
41
|
+
nPOTScale: 1
|
|
42
|
+
lightmap: 0
|
|
43
|
+
compressionQuality: 50
|
|
44
|
+
spriteMode: 0
|
|
45
|
+
spriteExtrude: 1
|
|
46
|
+
spriteMeshType: 1
|
|
47
|
+
alignment: 0
|
|
48
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
49
|
+
spritePixelsToUnits: 100
|
|
50
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
51
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
52
|
+
alphaUsage: 1
|
|
53
|
+
alphaIsTransparency: 1
|
|
54
|
+
spriteTessellationDetail: -1
|
|
55
|
+
textureType: 0
|
|
56
|
+
textureShape: 1
|
|
57
|
+
singleChannelComponent: 0
|
|
58
|
+
flipbookRows: 1
|
|
59
|
+
flipbookColumns: 1
|
|
60
|
+
maxTextureSizeSet: 0
|
|
61
|
+
compressionQualitySet: 0
|
|
62
|
+
textureFormatSet: 0
|
|
63
|
+
ignorePngGamma: 0
|
|
64
|
+
applyGammaDecoding: 0
|
|
65
|
+
platformSettings:
|
|
66
|
+
- serializedVersion: 3
|
|
67
|
+
buildTarget: DefaultTexturePlatform
|
|
68
|
+
maxTextureSize: 2048
|
|
69
|
+
resizeAlgorithm: 0
|
|
70
|
+
textureFormat: -1
|
|
71
|
+
textureCompression: 1
|
|
72
|
+
compressionQuality: 50
|
|
73
|
+
crunchedCompression: 0
|
|
74
|
+
allowsAlphaSplitting: 0
|
|
75
|
+
overridden: 0
|
|
76
|
+
androidETC2FallbackOverride: 0
|
|
77
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
78
|
+
- serializedVersion: 3
|
|
79
|
+
buildTarget: Standalone
|
|
80
|
+
maxTextureSize: 2048
|
|
81
|
+
resizeAlgorithm: 0
|
|
82
|
+
textureFormat: -1
|
|
83
|
+
textureCompression: 1
|
|
84
|
+
compressionQuality: 50
|
|
85
|
+
crunchedCompression: 0
|
|
86
|
+
allowsAlphaSplitting: 0
|
|
87
|
+
overridden: 0
|
|
88
|
+
androidETC2FallbackOverride: 0
|
|
89
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
90
|
+
- serializedVersion: 3
|
|
91
|
+
buildTarget: iPhone
|
|
92
|
+
maxTextureSize: 2048
|
|
93
|
+
resizeAlgorithm: 0
|
|
94
|
+
textureFormat: -1
|
|
95
|
+
textureCompression: 1
|
|
96
|
+
compressionQuality: 50
|
|
97
|
+
crunchedCompression: 0
|
|
98
|
+
allowsAlphaSplitting: 0
|
|
99
|
+
overridden: 0
|
|
100
|
+
androidETC2FallbackOverride: 0
|
|
101
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
102
|
+
- serializedVersion: 3
|
|
103
|
+
buildTarget: WebGL
|
|
104
|
+
maxTextureSize: 2048
|
|
105
|
+
resizeAlgorithm: 0
|
|
106
|
+
textureFormat: -1
|
|
107
|
+
textureCompression: 1
|
|
108
|
+
compressionQuality: 50
|
|
109
|
+
crunchedCompression: 0
|
|
110
|
+
allowsAlphaSplitting: 0
|
|
111
|
+
overridden: 0
|
|
112
|
+
androidETC2FallbackOverride: 0
|
|
113
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
114
|
+
- serializedVersion: 3
|
|
115
|
+
buildTarget: Android
|
|
116
|
+
maxTextureSize: 2048
|
|
117
|
+
resizeAlgorithm: 0
|
|
118
|
+
textureFormat: -1
|
|
119
|
+
textureCompression: 1
|
|
120
|
+
compressionQuality: 50
|
|
121
|
+
crunchedCompression: 0
|
|
122
|
+
allowsAlphaSplitting: 0
|
|
123
|
+
overridden: 0
|
|
124
|
+
androidETC2FallbackOverride: 0
|
|
125
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
126
|
+
spriteSheet:
|
|
127
|
+
serializedVersion: 2
|
|
128
|
+
sprites: []
|
|
129
|
+
outline: []
|
|
130
|
+
physicsShape: []
|
|
131
|
+
bones: []
|
|
132
|
+
spriteID:
|
|
133
|
+
internalID: 0
|
|
134
|
+
vertices: []
|
|
135
|
+
indices:
|
|
136
|
+
edges: []
|
|
137
|
+
weights: []
|
|
138
|
+
secondaryTextures: []
|
|
139
|
+
spritePackingTag:
|
|
140
|
+
pSDRemoveMatte: 0
|
|
141
|
+
pSDShowRemoveMatteOption: 0
|
|
142
|
+
userData:
|
|
143
|
+
assetBundleName:
|
|
144
|
+
assetBundleVariant:
|
|
Binary file
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 01ab6d066fda9ae4ab539f69e9f9c0df
|
|
3
|
+
TextureImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 11
|
|
7
|
+
mipmaps:
|
|
8
|
+
mipMapMode: 0
|
|
9
|
+
enableMipMap: 1
|
|
10
|
+
sRGBTexture: 1
|
|
11
|
+
linearTexture: 0
|
|
12
|
+
fadeOut: 0
|
|
13
|
+
borderMipMap: 0
|
|
14
|
+
mipMapsPreserveCoverage: 0
|
|
15
|
+
alphaTestReferenceValue: 0.5
|
|
16
|
+
mipMapFadeDistanceStart: 1
|
|
17
|
+
mipMapFadeDistanceEnd: 3
|
|
18
|
+
bumpmap:
|
|
19
|
+
convertToNormalMap: 0
|
|
20
|
+
externalNormalMap: 0
|
|
21
|
+
heightScale: 0.25
|
|
22
|
+
normalMapFilter: 0
|
|
23
|
+
isReadable: 0
|
|
24
|
+
streamingMipmaps: 0
|
|
25
|
+
streamingMipmapsPriority: 0
|
|
26
|
+
vTOnly: 0
|
|
27
|
+
grayScaleToAlpha: 0
|
|
28
|
+
generateCubemap: 6
|
|
29
|
+
cubemapConvolution: 0
|
|
30
|
+
seamlessCubemap: 0
|
|
31
|
+
textureFormat: 1
|
|
32
|
+
maxTextureSize: 2048
|
|
33
|
+
textureSettings:
|
|
34
|
+
serializedVersion: 2
|
|
35
|
+
filterMode: 1
|
|
36
|
+
aniso: 1
|
|
37
|
+
mipBias: 0
|
|
38
|
+
wrapU: 0
|
|
39
|
+
wrapV: 0
|
|
40
|
+
wrapW: 0
|
|
41
|
+
nPOTScale: 1
|
|
42
|
+
lightmap: 0
|
|
43
|
+
compressionQuality: 50
|
|
44
|
+
spriteMode: 0
|
|
45
|
+
spriteExtrude: 1
|
|
46
|
+
spriteMeshType: 1
|
|
47
|
+
alignment: 0
|
|
48
|
+
spritePivot: {x: 0.5, y: 0.5}
|
|
49
|
+
spritePixelsToUnits: 100
|
|
50
|
+
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
51
|
+
spriteGenerateFallbackPhysicsShape: 1
|
|
52
|
+
alphaUsage: 1
|
|
53
|
+
alphaIsTransparency: 1
|
|
54
|
+
spriteTessellationDetail: -1
|
|
55
|
+
textureType: 0
|
|
56
|
+
textureShape: 1
|
|
57
|
+
singleChannelComponent: 0
|
|
58
|
+
flipbookRows: 1
|
|
59
|
+
flipbookColumns: 1
|
|
60
|
+
maxTextureSizeSet: 0
|
|
61
|
+
compressionQualitySet: 0
|
|
62
|
+
textureFormatSet: 0
|
|
63
|
+
ignorePngGamma: 0
|
|
64
|
+
applyGammaDecoding: 0
|
|
65
|
+
platformSettings:
|
|
66
|
+
- serializedVersion: 3
|
|
67
|
+
buildTarget: DefaultTexturePlatform
|
|
68
|
+
maxTextureSize: 2048
|
|
69
|
+
resizeAlgorithm: 0
|
|
70
|
+
textureFormat: -1
|
|
71
|
+
textureCompression: 1
|
|
72
|
+
compressionQuality: 50
|
|
73
|
+
crunchedCompression: 0
|
|
74
|
+
allowsAlphaSplitting: 0
|
|
75
|
+
overridden: 0
|
|
76
|
+
androidETC2FallbackOverride: 0
|
|
77
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
78
|
+
- serializedVersion: 3
|
|
79
|
+
buildTarget: Standalone
|
|
80
|
+
maxTextureSize: 2048
|
|
81
|
+
resizeAlgorithm: 0
|
|
82
|
+
textureFormat: -1
|
|
83
|
+
textureCompression: 1
|
|
84
|
+
compressionQuality: 50
|
|
85
|
+
crunchedCompression: 0
|
|
86
|
+
allowsAlphaSplitting: 0
|
|
87
|
+
overridden: 0
|
|
88
|
+
androidETC2FallbackOverride: 0
|
|
89
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
90
|
+
- serializedVersion: 3
|
|
91
|
+
buildTarget: iPhone
|
|
92
|
+
maxTextureSize: 2048
|
|
93
|
+
resizeAlgorithm: 0
|
|
94
|
+
textureFormat: -1
|
|
95
|
+
textureCompression: 1
|
|
96
|
+
compressionQuality: 50
|
|
97
|
+
crunchedCompression: 0
|
|
98
|
+
allowsAlphaSplitting: 0
|
|
99
|
+
overridden: 0
|
|
100
|
+
androidETC2FallbackOverride: 0
|
|
101
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
102
|
+
- serializedVersion: 3
|
|
103
|
+
buildTarget: WebGL
|
|
104
|
+
maxTextureSize: 2048
|
|
105
|
+
resizeAlgorithm: 0
|
|
106
|
+
textureFormat: -1
|
|
107
|
+
textureCompression: 1
|
|
108
|
+
compressionQuality: 50
|
|
109
|
+
crunchedCompression: 0
|
|
110
|
+
allowsAlphaSplitting: 0
|
|
111
|
+
overridden: 0
|
|
112
|
+
androidETC2FallbackOverride: 0
|
|
113
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
114
|
+
- serializedVersion: 3
|
|
115
|
+
buildTarget: Android
|
|
116
|
+
maxTextureSize: 2048
|
|
117
|
+
resizeAlgorithm: 0
|
|
118
|
+
textureFormat: -1
|
|
119
|
+
textureCompression: 1
|
|
120
|
+
compressionQuality: 50
|
|
121
|
+
crunchedCompression: 0
|
|
122
|
+
allowsAlphaSplitting: 0
|
|
123
|
+
overridden: 0
|
|
124
|
+
androidETC2FallbackOverride: 0
|
|
125
|
+
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
126
|
+
spriteSheet:
|
|
127
|
+
serializedVersion: 2
|
|
128
|
+
sprites: []
|
|
129
|
+
outline: []
|
|
130
|
+
physicsShape: []
|
|
131
|
+
bones: []
|
|
132
|
+
spriteID:
|
|
133
|
+
internalID: 0
|
|
134
|
+
vertices: []
|
|
135
|
+
indices:
|
|
136
|
+
edges: []
|
|
137
|
+
weights: []
|
|
138
|
+
secondaryTextures: []
|
|
139
|
+
spritePackingTag:
|
|
140
|
+
pSDRemoveMatte: 0
|
|
141
|
+
pSDShowRemoveMatteOption: 0
|
|
142
|
+
userData:
|
|
143
|
+
assetBundleName:
|
|
144
|
+
assetBundleVariant:
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#if UNITY_EDITOR
|
|
2
2
|
using System;
|
|
3
|
-
using UnityEditor;
|
|
4
3
|
using UnityEngine;
|
|
5
4
|
|
|
6
5
|
namespace TyphoonUnitySDK
|
|
@@ -10,30 +9,6 @@ namespace TyphoonUnitySDK
|
|
|
10
9
|
/// </summary>
|
|
11
10
|
public class SimulateRecordGame : MonoSingleton<SimulateRecordGame>
|
|
12
11
|
{
|
|
13
|
-
private static GUIStyle _boldLabel = null;
|
|
14
|
-
|
|
15
|
-
public static GUIStyle BoldLabel
|
|
16
|
-
{
|
|
17
|
-
get
|
|
18
|
-
{
|
|
19
|
-
if (_boldLabel == null)
|
|
20
|
-
{
|
|
21
|
-
_boldLabel = new GUIStyle(GUI.skin.label);
|
|
22
|
-
_boldLabel.alignment = TextAnchor.MiddleCenter;
|
|
23
|
-
_boldLabel.fixedWidth = 0;
|
|
24
|
-
_boldLabel.fixedHeight = 0;
|
|
25
|
-
_boldLabel.fontSize = 30;
|
|
26
|
-
_boldLabel.fontStyle = FontStyle.Bold;
|
|
27
|
-
_boldLabel.normal.textColor = Color.white;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return _boldLabel;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
public static float HOLD_TIME => SdkTestInUnity.Instance.InteractiveHoldCloseTime;
|
|
36
|
-
|
|
37
12
|
/*是否在录制中*/
|
|
38
13
|
public bool IsRecording = false;
|
|
39
14
|
|
|
@@ -43,16 +18,6 @@ namespace TyphoonUnitySDK
|
|
|
43
18
|
/*录制时长*/
|
|
44
19
|
public float RecordTime;
|
|
45
20
|
|
|
46
|
-
/*展示*/
|
|
47
|
-
public bool IsShow = false;
|
|
48
|
-
|
|
49
|
-
public float HoldTimeYes;
|
|
50
|
-
|
|
51
|
-
public float HoldTimeNo;
|
|
52
|
-
|
|
53
|
-
private Action _onSuccess;
|
|
54
|
-
private Action _onFail;
|
|
55
|
-
|
|
56
21
|
|
|
57
22
|
protected override void Init()
|
|
58
23
|
{
|
|
@@ -110,97 +75,8 @@ namespace TyphoonUnitySDK
|
|
|
110
75
|
return;
|
|
111
76
|
}
|
|
112
77
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
IsShow = true;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
private void OnGUI()
|
|
120
|
-
{
|
|
121
|
-
if (IsShow)
|
|
122
|
-
{
|
|
123
|
-
var rect = new Rect(0, 0, Screen.width, Screen.height);
|
|
124
|
-
|
|
125
|
-
// var retTitle = rect;
|
|
126
|
-
// retTitle.width = 400;
|
|
127
|
-
// retTitle.height = 128;
|
|
128
|
-
// retTitle.center = rect.center;
|
|
129
|
-
// retTitle.y -= 400;
|
|
130
|
-
// DrawViewTxtLabel(retTitle, "悬停选择", TextAnchor.MiddleCenter, 1);
|
|
131
|
-
|
|
132
|
-
var rectBtnYes = rect;
|
|
133
|
-
rectBtnYes.width = 346;
|
|
134
|
-
rectBtnYes.height = 200;
|
|
135
|
-
rectBtnYes.center = rect.center;
|
|
136
|
-
rectBtnYes.y += rectBtnYes.height;
|
|
137
|
-
DrawViewTxtLabel(rectBtnYes, "分享成功", TextAnchor.MiddleCenter, 1);
|
|
138
|
-
|
|
139
|
-
var rectBtnNo = rectBtnYes;
|
|
140
|
-
rectBtnNo.center = rect.center;
|
|
141
|
-
rectBtnNo.y -= rectBtnNo.height;
|
|
142
|
-
DrawViewTxtLabel(rectBtnNo, "分享失败", TextAnchor.MiddleCenter, 1);
|
|
143
|
-
|
|
144
|
-
HoldHide(rectBtnYes, ref HoldTimeYes, () =>
|
|
145
|
-
{
|
|
146
|
-
_onSuccess?.Invoke();
|
|
147
|
-
Hide();
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
HoldHide(rectBtnNo, ref HoldTimeNo, () =>
|
|
151
|
-
{
|
|
152
|
-
_onFail?.Invoke();
|
|
153
|
-
Hide();
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
private void Hide()
|
|
159
|
-
{
|
|
160
|
-
IsShow = false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/*长按隐藏*/
|
|
165
|
-
private void HoldHide(Rect rectClose, ref float holdTime, Action hideHandler)
|
|
166
|
-
{
|
|
167
|
-
var inside = rectClose.Contains(Event.current.mousePosition);
|
|
168
|
-
if (inside && Event.current.delta == Vector2.zero)
|
|
169
|
-
{
|
|
170
|
-
holdTime += Time.unscaledDeltaTime;
|
|
171
|
-
var process = Mathf.Clamp01(holdTime / HOLD_TIME);
|
|
172
|
-
var rectProcess = rectClose;
|
|
173
|
-
rectProcess.width *= process;
|
|
174
|
-
var color = GUI.color;
|
|
175
|
-
EditorGUI.DrawRect(rectProcess, Color.green * 0.5f);
|
|
176
|
-
if (process >= 1)
|
|
177
|
-
{
|
|
178
|
-
hideHandler?.Invoke();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
else
|
|
182
|
-
{
|
|
183
|
-
holdTime = 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (inside && Event.current.type == EventType.MouseDown)
|
|
187
|
-
{
|
|
188
|
-
hideHandler?.Invoke();
|
|
189
|
-
Event.current.Use();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
private void DrawViewTxtLabel(Rect rect, string label, TextAnchor alignment = TextAnchor.MiddleCenter,
|
|
195
|
-
float dark = 0.75f)
|
|
196
|
-
{
|
|
197
|
-
EditorGUI.DrawRect(rect, Color.black * dark);
|
|
198
|
-
var rectLab = rect;
|
|
199
|
-
rectLab.width -= 10;
|
|
200
|
-
rectLab.height -= 10;
|
|
201
|
-
rectLab.center = rect.center;
|
|
202
|
-
BoldLabel.alignment = alignment;
|
|
203
|
-
GUI.Label(rectLab, label, BoldLabel);
|
|
78
|
+
UnityGUIMessageBox.Instance.Show("请选择分享返回结果", "成功返回", "失败返回", () => success?.Invoke(),
|
|
79
|
+
() => fail?.Invoke());
|
|
204
80
|
}
|
|
205
81
|
}
|
|
206
82
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
using System;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// 只能在Unity中调用
|
|
9
|
+
/// </summary>
|
|
10
|
+
internal class UnityGUIMessageBox : MonoSingleton<UnityGUIMessageBox>
|
|
11
|
+
{
|
|
12
|
+
private const float HOLD_TIME = 1.3F;
|
|
13
|
+
public bool IsShow = false;
|
|
14
|
+
public string Content;
|
|
15
|
+
public string TxtYes;
|
|
16
|
+
public string TxtNo;
|
|
17
|
+
private Texture _black;
|
|
18
|
+
private Texture _green;
|
|
19
|
+
private float _holdTimeYes;
|
|
20
|
+
private float _holdTimeNo;
|
|
21
|
+
private GUIStyle _labelStyle = null;
|
|
22
|
+
private Action _onYes;
|
|
23
|
+
private Action _onNo;
|
|
24
|
+
|
|
25
|
+
private GUIStyle LabelStyle
|
|
26
|
+
{
|
|
27
|
+
get
|
|
28
|
+
{
|
|
29
|
+
if (_labelStyle == null)
|
|
30
|
+
{
|
|
31
|
+
_labelStyle = GUI.skin.label;
|
|
32
|
+
_labelStyle.fontSize = 32;
|
|
33
|
+
_labelStyle.fontStyle = FontStyle.Bold;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return _labelStyle;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
protected override void Init()
|
|
42
|
+
{
|
|
43
|
+
base.Init();
|
|
44
|
+
DontDestroyOnLoad(gameObject);
|
|
45
|
+
_black = Resources.Load<Texture>("TYPHOON_TEXTURE_TOAST_BLACK");
|
|
46
|
+
_green = Resources.Load<Texture>("TYPHOON_TEXTURE_TOAST_GREEN_ALPHA");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public void Show(string content, string txtYes = "是", string txtNo = "否", Action success = null,
|
|
50
|
+
Action fail = null)
|
|
51
|
+
{
|
|
52
|
+
_onYes = success;
|
|
53
|
+
_onNo = fail;
|
|
54
|
+
Content = content;
|
|
55
|
+
TxtYes = txtYes;
|
|
56
|
+
TxtNo = txtNo;
|
|
57
|
+
IsShow = true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private void OnGUI()
|
|
61
|
+
{
|
|
62
|
+
if (IsShow)
|
|
63
|
+
{
|
|
64
|
+
var rect = new Rect(0, 0, Screen.width, Screen.height);
|
|
65
|
+
var rectContent = rect;
|
|
66
|
+
rectContent.width = rect.width * 0.8f;
|
|
67
|
+
rectContent.height = Mathf.Min(rect.height * 0.3f, 260);
|
|
68
|
+
rectContent.center = rect.center;
|
|
69
|
+
rectContent.y -= rectContent.height * 0.5f;
|
|
70
|
+
rectContent.y -= 20;
|
|
71
|
+
DrawLabel(rectContent, Content);
|
|
72
|
+
var rectYes = rectContent;
|
|
73
|
+
rectYes.width = rectContent.width * 0.5f - 20;
|
|
74
|
+
rectYes.height = rectContent.height * 0.5f;
|
|
75
|
+
rectYes.y = rect.center.y + 20;
|
|
76
|
+
rectYes.x = rect.center.x + 20;
|
|
77
|
+
var rectNo = rectYes;
|
|
78
|
+
rectNo.x = rect.center.x - rectNo.width - 20;
|
|
79
|
+
DrawLabel(rectYes, TxtYes);
|
|
80
|
+
DrawLabel(rectNo, TxtNo);
|
|
81
|
+
HoldHide(rectYes, ref _holdTimeYes, () =>
|
|
82
|
+
{
|
|
83
|
+
_onYes?.Invoke();
|
|
84
|
+
IsShow = false;
|
|
85
|
+
});
|
|
86
|
+
HoldHide(rectNo, ref _holdTimeNo, () =>
|
|
87
|
+
{
|
|
88
|
+
_onNo?.Invoke();
|
|
89
|
+
IsShow = false;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private void DrawLabel(Rect rect, string content, TextAnchor anchor = TextAnchor.MiddleCenter,
|
|
95
|
+
int fontSize = 32)
|
|
96
|
+
{
|
|
97
|
+
GUI.DrawTexture(rect, _black, ScaleMode.StretchToFill, true);
|
|
98
|
+
LabelStyle.alignment = anchor;
|
|
99
|
+
LabelStyle.fontSize = fontSize;
|
|
100
|
+
GUI.Label(rect, content, LabelStyle);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
private void HoldHide(Rect rectClose, ref float holdTime, Action hideHandler)
|
|
105
|
+
{
|
|
106
|
+
var inside = rectClose.Contains(Event.current.mousePosition);
|
|
107
|
+
if (inside && Event.current.delta == Vector2.zero)
|
|
108
|
+
{
|
|
109
|
+
holdTime += Time.unscaledDeltaTime;
|
|
110
|
+
var process = Mathf.Clamp01(holdTime / HOLD_TIME);
|
|
111
|
+
var rectProcess = rectClose;
|
|
112
|
+
rectProcess.width *= process;
|
|
113
|
+
GUI.DrawTexture(rectProcess, _green, ScaleMode.StretchToFill, true);
|
|
114
|
+
if (process >= 1)
|
|
115
|
+
{
|
|
116
|
+
hideHandler?.Invoke();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else
|
|
120
|
+
{
|
|
121
|
+
holdTime = 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (inside && Event.current.type == EventType.MouseDown)
|
|
125
|
+
{
|
|
126
|
+
hideHandler?.Invoke();
|
|
127
|
+
Event.current.Use();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
#endif
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: cc71c8df38c4cbc488bf89567ae58dc9
|
|
3
|
+
TrueTypeFontImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 4
|
|
6
|
+
fontSize: 16
|
|
7
|
+
forceTextureCase: -2
|
|
8
|
+
characterSpacing: 0
|
|
9
|
+
characterPadding: 1
|
|
10
|
+
includeFontData: 1
|
|
11
|
+
fontNames:
|
|
12
|
+
- ZiZhiQuXiMaiTi
|
|
13
|
+
fallbackFontReferences: []
|
|
14
|
+
customCharacters:
|
|
15
|
+
fontRenderingMode: 0
|
|
16
|
+
ascentCalculationMode: 1
|
|
17
|
+
useLegacyBoundsCalculation: 0
|
|
18
|
+
shouldRoundAdvanceValue: 1
|
|
19
|
+
userData:
|
|
20
|
+
assetBundleName:
|
|
21
|
+
assetBundleVariant:
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast
|
|
2
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Resources.meta
|
|
3
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Runtime.meta
|
|
4
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Toast_White.png
|
|
5
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Toast_White.png.meta
|
|
6
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/ximaiti SDF.asset
|
|
7
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/ximaiti SDF.asset.meta
|
|
8
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Resources/TYPHOON_SDK_TOAST_CANVAS.prefab
|
|
9
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Resources/TYPHOON_SDK_TOAST_CANVAS.prefab.meta
|
|
10
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Runtime/Toast.cs
|
|
11
|
+
Assets/Typhoon_Gen/TyphoonSDK/Toast/Runtime/Toast.cs.meta
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.
|
|
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"}}
|
package/Editor/InstallModule.cs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
using UnityEditor;
|
|
2
|
-
|
|
3
|
-
namespace TyphoonUnitySDK
|
|
4
|
-
{
|
|
5
|
-
[InitializeOnLoad]
|
|
6
|
-
public class InstallModule
|
|
7
|
-
{
|
|
8
|
-
static InstallModule()
|
|
9
|
-
{
|
|
10
|
-
#if !TYPHOON_ADDRESSABLE
|
|
11
|
-
if (Preferences.Default.CheckInstallAddressablePlug)
|
|
12
|
-
{
|
|
13
|
-
if (UniEditor.HasAddressable())
|
|
14
|
-
{
|
|
15
|
-
var complex =
|
|
16
|
-
UniEditor.ShowMessageBoxComplex("推荐补充Addressable拓展功能,安装?\n\r可从'TyphoonSDK/选项'中关闭检查", null,
|
|
17
|
-
null);
|
|
18
|
-
switch (complex)
|
|
19
|
-
{
|
|
20
|
-
case ComplexType.Yes:
|
|
21
|
-
UniEditor.InstallAddressableSupport();
|
|
22
|
-
break;
|
|
23
|
-
case ComplexType.No:
|
|
24
|
-
break;
|
|
25
|
-
case ComplexType.Alt:
|
|
26
|
-
{
|
|
27
|
-
Preferences.Default.CheckInstallAddressablePlug = false;
|
|
28
|
-
EditorUtility.SetDirty(Preferences.Default);
|
|
29
|
-
AssetDatabase.SaveAssets();
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
#endif
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|