com.typhoon.unitysdk 1.0.20 → 1.0.23
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 +31 -0
- package/Editor/DouyinConfig.cs +132 -0
- package/Editor/{WxMiniConfigWindow.cs.meta → DouyinConfig.cs.meta} +1 -1
- package/Editor/ExportModule.cs +21 -0
- package/Editor/GUIDrawer.cs +31 -0
- package/Editor/PublishProcess.cs +4 -2
- package/Editor/PublishResult.cs +5 -0
- package/Editor/PublishSetting.cs +3 -0
- package/Editor/PublishSettingGUIDrawer.cs +19 -0
- package/Editor/PublishTool.cs +4 -1
- package/Editor/PublishVivoBatSettingInspector.cs +1 -1
- package/Editor/PublishWindow.cs +3 -2
- package/Editor/Texture/sdk_white4x4.png +0 -0
- package/Editor/Texture/sdk_white4x4.png.meta +144 -0
- package/Editor/UniEditor.cs +6 -0
- package/Runtime/AppConfig.cs +16 -0
- package/Runtime/AppConfigAsset.cs +5 -2
- package/Runtime/BaseSdk.cs +44 -3
- package/Runtime/Interface.cs +34 -2
- package/Runtime/Model.cs +25 -0
- package/Runtime/{UnityToJs.cs.meta → Model.cs.meta} +1 -1
- package/Runtime/RuntimeUtil.cs +23 -0
- package/Runtime/RuntimeUtil.cs.meta +11 -0
- package/Runtime/SDKInteractiveUI.cs +2 -13
- package/Runtime/SimulateRecordGame.cs +208 -0
- package/Runtime/SimulateRecordGame.cs.meta +11 -0
- package/Runtime/TyphoonSdk.cs +123 -0
- package/Sources~/Package/ChinaAndroid.unitypackage +0 -0
- package/Sources~/Package/Douyin.unitypackage +0 -0
- package/Sources~/Package/Douyin.unitypackage.manifest +103 -0
- package/Sources~/Package/WxMini.unitypackage +0 -0
- package/Sources~/Package/WxMini.unitypackage.manifest +2 -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 -1
- package/Editor/WxMiniConfigWindow.cs +0 -58
- package/Runtime/UnityToJs.cs +0 -64
package/Runtime/Interface.cs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
2
3
|
|
|
3
4
|
namespace TyphoonUnitySDK
|
|
4
5
|
{
|
|
@@ -6,7 +7,7 @@ namespace TyphoonUnitySDK
|
|
|
6
7
|
/// SDK全功能接口
|
|
7
8
|
/// </summary>
|
|
8
9
|
public interface ISdk : IOnCreate, IInitSdk, ILogin, IExitGame, IBannerAD, IVideoAD, IIntersAD, IFloatIconAD,
|
|
9
|
-
INativeAD
|
|
10
|
+
INativeAD, IRecordGame
|
|
10
11
|
{
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -19,7 +20,6 @@ namespace TyphoonUnitySDK
|
|
|
19
20
|
|
|
20
21
|
#endregion
|
|
21
22
|
|
|
22
|
-
|
|
23
23
|
#region 初始化
|
|
24
24
|
|
|
25
25
|
public interface IInitSdk
|
|
@@ -112,4 +112,36 @@ namespace TyphoonUnitySDK
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
#endregion
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
#region 录屏分享(抖音小游戏)
|
|
118
|
+
|
|
119
|
+
/*录屏分享(抖音)*/
|
|
120
|
+
public interface IRecordGame
|
|
121
|
+
{
|
|
122
|
+
/*是否可以录屏*/
|
|
123
|
+
bool CanRecordGame();
|
|
124
|
+
|
|
125
|
+
/*开启录屏*/
|
|
126
|
+
void StartRecordGame(bool isRecordAudio = true, int maxRecordTimeSec = 600,
|
|
127
|
+
Action onStart = null, Action<string> onError = null, Action<string> onComplete = null);
|
|
128
|
+
|
|
129
|
+
/*结束录屏*/
|
|
130
|
+
void StopRecordGame(Action<string> complete = null, Action<string> onError = null,
|
|
131
|
+
List<TimeClip> clips = null,
|
|
132
|
+
bool autoMerge = true);
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
/*获取录屏时间*/
|
|
136
|
+
float GetRecordDuration();
|
|
137
|
+
|
|
138
|
+
/*可分享游戏录屏*/
|
|
139
|
+
bool CanShareRecordGame();
|
|
140
|
+
|
|
141
|
+
/*分享游戏录屏*/
|
|
142
|
+
void ShareRecordGame(string title, List<string> topics, Action success, Action<string> fail = null,
|
|
143
|
+
Action cancel = null);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
#endregion
|
|
115
147
|
}
|
package/Runtime/Model.cs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
using System.Collections;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
public class Model
|
|
8
|
+
{
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// 时间片段,单位:毫秒
|
|
13
|
+
/// </summary>
|
|
14
|
+
public class TimeClip
|
|
15
|
+
{
|
|
16
|
+
public int Start;
|
|
17
|
+
public int End;
|
|
18
|
+
|
|
19
|
+
public TimeClip(int start, int end)
|
|
20
|
+
{
|
|
21
|
+
Start = start;
|
|
22
|
+
End = end;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
using System.Collections;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace TyphoonUnitySDK
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// runtime封装
|
|
10
|
+
/// </summary>
|
|
11
|
+
public class RuntimeUtil
|
|
12
|
+
{
|
|
13
|
+
public static string GetPathRoot()
|
|
14
|
+
{
|
|
15
|
+
if (Directory.Exists("Assets/com.typhoon.unitysdk"))
|
|
16
|
+
{
|
|
17
|
+
return "Assets/com.typhoon.unitysdk";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return "Packages/com.typhoon.unitysdk";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -16,18 +16,7 @@ namespace TyphoonUnitySDK
|
|
|
16
16
|
#if UNITY_EDITOR
|
|
17
17
|
public static float HOLD_TIME = SdkTestInUnity.Instance.InteractiveHoldCloseTime;
|
|
18
18
|
|
|
19
|
-
public static string PathRoot
|
|
20
|
-
{
|
|
21
|
-
get
|
|
22
|
-
{
|
|
23
|
-
if (Directory.Exists("Assets/com.typhoon.unitysdk"))
|
|
24
|
-
{
|
|
25
|
-
return "Assets/com.typhoon.unitysdk";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return "Packages/com.typhoon.unitysdk";
|
|
29
|
-
}
|
|
30
|
-
}
|
|
19
|
+
public static string PathRoot => RuntimeUtil.GetPathRoot();
|
|
31
20
|
|
|
32
21
|
/// <summary>
|
|
33
22
|
/// 横竖屏模式
|
|
@@ -496,7 +485,7 @@ namespace TyphoonUnitySDK
|
|
|
496
485
|
view.y = Mathf.Lerp(0, rect.width, Sp.y);
|
|
497
486
|
GUI.DrawTexture(view, Image);
|
|
498
487
|
var rectClose = view;
|
|
499
|
-
DrawViewTxtLabel(rectClose, "关闭", TextAnchor.UpperRight,0.3f);
|
|
488
|
+
DrawViewTxtLabel(rectClose, "关闭", TextAnchor.UpperRight, 0.3f);
|
|
500
489
|
HoldHide(rectClose, ref HoldTime, Hide);
|
|
501
490
|
}
|
|
502
491
|
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
using System;
|
|
3
|
+
using UnityEditor;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace TyphoonUnitySDK
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// 模拟录屏分享
|
|
10
|
+
/// </summary>
|
|
11
|
+
public class SimulateRecordGame : MonoSingleton<SimulateRecordGame>
|
|
12
|
+
{
|
|
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
|
+
/*是否在录制中*/
|
|
38
|
+
public bool IsRecording = false;
|
|
39
|
+
|
|
40
|
+
/*开始时间*/
|
|
41
|
+
public float StartTime;
|
|
42
|
+
|
|
43
|
+
/*录制时长*/
|
|
44
|
+
public float RecordTime;
|
|
45
|
+
|
|
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
|
+
|
|
57
|
+
protected override void Init()
|
|
58
|
+
{
|
|
59
|
+
base.Init();
|
|
60
|
+
DontDestroyOnLoad(gameObject);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
public bool CanRecord()
|
|
65
|
+
{
|
|
66
|
+
return AppConfig.Channel == AppChannel.DouyinAndroid;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public float GetDuration()
|
|
70
|
+
{
|
|
71
|
+
if (IsRecording)
|
|
72
|
+
{
|
|
73
|
+
return Time.time - StartTime;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public void StartRecord(Action onStart)
|
|
80
|
+
{
|
|
81
|
+
onStart?.Invoke();
|
|
82
|
+
IsRecording = true;
|
|
83
|
+
StartTime = Time.time;
|
|
84
|
+
RecordTime = 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public void StopRecord(Action<string> complete)
|
|
88
|
+
{
|
|
89
|
+
complete?.Invoke("video_xxxx,(本地模拟,实际以发布后为准)");
|
|
90
|
+
IsRecording = false;
|
|
91
|
+
RecordTime = Time.time - StartTime;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
public bool CanShare()
|
|
96
|
+
{
|
|
97
|
+
if (IsRecording)
|
|
98
|
+
{
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return RecordTime > 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public void Share(Action success, Action fail)
|
|
106
|
+
{
|
|
107
|
+
if (!CanShare())
|
|
108
|
+
{
|
|
109
|
+
fail?.Invoke();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
_onSuccess = success;
|
|
114
|
+
_onFail = fail;
|
|
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);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
#endif
|
package/Runtime/TyphoonSdk.cs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
using System;
|
|
2
|
+
using System.Collections;
|
|
2
3
|
using System.Collections.Generic;
|
|
3
4
|
using UnityEngine;
|
|
4
5
|
|
|
@@ -15,6 +16,8 @@ namespace TyphoonUnitySDK
|
|
|
15
16
|
{ AppChannel.Test, "TYPHOON_SDK_TEST" }, //测试渠道
|
|
16
17
|
{ AppChannel.ChinaAndroid, "TYPHOON_SDK_CHINA_ANDROID" }, //国内安卓
|
|
17
18
|
{ AppChannel.WxMini, "TYPHOON_SDK_WX_MINI" }, //微信小游戏
|
|
19
|
+
{ AppChannel.DouyinAndroid, "TYPHOON_SDK_DOUYIN_MINI" }, //抖音小游戏
|
|
20
|
+
{ AppChannel.DouyinIOS, "TYPHOON_SDK_DOUYIN_MINI" }, //抖音小游戏
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
private ISdk _sdk;
|
|
@@ -31,6 +34,9 @@ namespace TyphoonUnitySDK
|
|
|
31
34
|
|
|
32
35
|
private void CreateSDK()
|
|
33
36
|
{
|
|
37
|
+
#if UNITY_EDITOR
|
|
38
|
+
return;
|
|
39
|
+
#endif
|
|
34
40
|
if (SDKBindings.TryGetValue(AppConfig.Channel, out var match))
|
|
35
41
|
{
|
|
36
42
|
var source = Resources.Load<GameObject>(match);
|
|
@@ -383,5 +389,122 @@ namespace TyphoonUnitySDK
|
|
|
383
389
|
}
|
|
384
390
|
|
|
385
391
|
#endregion
|
|
392
|
+
|
|
393
|
+
#region 协程
|
|
394
|
+
|
|
395
|
+
/// <summary>
|
|
396
|
+
/// 使用协程延迟处理逻辑
|
|
397
|
+
/// </summary>
|
|
398
|
+
public Coroutine WaitTo(float delay, Action handler)
|
|
399
|
+
{
|
|
400
|
+
return StartCoroutine(IeWaitTo(delay, handler));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
private IEnumerator IeWaitTo(float delay, Action handler)
|
|
404
|
+
{
|
|
405
|
+
yield return new WaitForSeconds(delay);
|
|
406
|
+
handler?.Invoke();
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/// <summary>
|
|
410
|
+
/// 中断协程
|
|
411
|
+
/// </summary>
|
|
412
|
+
public void KillWaitTo(Coroutine coroutine)
|
|
413
|
+
{
|
|
414
|
+
StopCoroutine(coroutine);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
#endregion
|
|
418
|
+
|
|
419
|
+
#region 录屏分享
|
|
420
|
+
|
|
421
|
+
/// <summary>
|
|
422
|
+
/// 是否支持录屏分享
|
|
423
|
+
/// </summary>
|
|
424
|
+
public bool CanRecordGame()
|
|
425
|
+
{
|
|
426
|
+
#if UNITY_EDITOR
|
|
427
|
+
return SimulateRecordGame.Instance.CanRecord();
|
|
428
|
+
#endif
|
|
429
|
+
return _sdk.CanRecordGame();
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/// <summary>
|
|
433
|
+
/// 开启录屏
|
|
434
|
+
/// </summary>
|
|
435
|
+
/// <param name="isRecordAudio">包含音频</param>
|
|
436
|
+
/// <param name="maxRecordTimeSec">最大录屏时长</param>
|
|
437
|
+
/// <param name="onStart">开始回调</param>
|
|
438
|
+
/// <param name="onError">错误回调</param>
|
|
439
|
+
/// <param name="onComplete">完成回调</param>
|
|
440
|
+
public void StartRecordGame(bool isRecordAudio = true, int maxRecordTimeSec = 600, Action onStart = null,
|
|
441
|
+
Action<string> onError = null, Action<string> onComplete = null)
|
|
442
|
+
{
|
|
443
|
+
#if UNITY_EDITOR
|
|
444
|
+
SimulateRecordGame.Instance.StartRecord(onStart);
|
|
445
|
+
return;
|
|
446
|
+
#endif
|
|
447
|
+
_sdk.StartRecordGame(isRecordAudio, maxRecordTimeSec, onStart, onError, onComplete);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/// <summary>
|
|
451
|
+
/// 停止录制
|
|
452
|
+
/// </summary>
|
|
453
|
+
/// <param name="complete">完成回调,返回videopath</param>
|
|
454
|
+
/// <param name="onError">错误回调</param>
|
|
455
|
+
/// <param name="clips">自定义剪辑片段,单位毫秒</param>
|
|
456
|
+
/// <param name="autoMerge">自动合并</param>
|
|
457
|
+
public void StopRecordGame(Action<string> complete = null, Action<string> onError = null,
|
|
458
|
+
List<TimeClip> clips = null, bool autoMerge = true)
|
|
459
|
+
{
|
|
460
|
+
#if UNITY_EDITOR
|
|
461
|
+
SimulateRecordGame.Instance.StopRecord(complete);
|
|
462
|
+
return;
|
|
463
|
+
#endif
|
|
464
|
+
_sdk.StopRecordGame(complete, onError, clips, autoMerge);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/// <summary>
|
|
468
|
+
/// 获取录屏时长
|
|
469
|
+
/// </summary>
|
|
470
|
+
public float GetRecordDuration()
|
|
471
|
+
{
|
|
472
|
+
#if UNITY_EDITOR
|
|
473
|
+
return SimulateRecordGame.Instance.GetDuration();
|
|
474
|
+
#endif
|
|
475
|
+
return _sdk.GetRecordDuration();
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
/// <summary>
|
|
480
|
+
/// 是否可以分享录屏
|
|
481
|
+
/// </summary>
|
|
482
|
+
public bool CanShareRecordGame()
|
|
483
|
+
{
|
|
484
|
+
#if UNITY_EDITOR
|
|
485
|
+
return SimulateRecordGame.Instance.CanShare();
|
|
486
|
+
#endif
|
|
487
|
+
return _sdk.CanShareRecordGame();
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/// <summary>
|
|
491
|
+
/// 分享录屏
|
|
492
|
+
/// </summary>
|
|
493
|
+
/// <param name="title">标题</param>
|
|
494
|
+
/// <param name="topics">话题</param>
|
|
495
|
+
/// <param name="success">成功回调</param>
|
|
496
|
+
/// <param name="fail">失败回调</param>
|
|
497
|
+
/// <param name="cancel">取消回调</param>
|
|
498
|
+
public void ShareRecordGame(string title, List<string> topics, Action success, Action<string> fail = null,
|
|
499
|
+
Action cancel = null)
|
|
500
|
+
{
|
|
501
|
+
#if UNITY_EDITOR
|
|
502
|
+
SimulateRecordGame.Instance.Share(success, () => fail?.Invoke("分享失败"));
|
|
503
|
+
return;
|
|
504
|
+
#endif
|
|
505
|
+
_sdk.ShareRecordGame(title, topics, success, fail, cancel);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
#endregion
|
|
386
509
|
}
|
|
387
510
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Assets/Plugins/ByteGame
|
|
2
|
+
Assets/Plugins/ByteGame/bgdt.txt
|
|
3
|
+
Assets/Plugins/ByteGame/bgdt.txt.meta
|
|
4
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt.meta
|
|
5
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.meta
|
|
6
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools.meta
|
|
7
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/Editor.meta
|
|
8
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/package.json
|
|
9
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/package.json.meta
|
|
10
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/Editor/bgdt.data
|
|
11
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/Editor/bgdt.data.meta
|
|
12
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/Editor/bgdt.dll
|
|
13
|
+
Assets/Plugins/ByteGame/com.bytedance.bgdt/Editor/bgdt.dll.meta
|
|
14
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons.meta
|
|
15
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson.meta
|
|
16
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/package.json
|
|
17
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/package.json.meta
|
|
18
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Resources.meta
|
|
19
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll
|
|
20
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.dll.meta
|
|
21
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml
|
|
22
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/starksdk.xml.meta
|
|
23
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL.meta
|
|
24
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/follow_icon.png
|
|
25
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/follow_icon.png.meta
|
|
26
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/follow_icon_show.png
|
|
27
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/follow_icon_show.png.meta
|
|
28
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_about.png
|
|
29
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_about.png.meta
|
|
30
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_character.png
|
|
31
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_character.png.meta
|
|
32
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_character2.png
|
|
33
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_character2.png.meta
|
|
34
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_show.png
|
|
35
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_show.png.meta
|
|
36
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_show2.png
|
|
37
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Icons/official_icon_show2.png.meta
|
|
38
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/IJsonWrapper.cs
|
|
39
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/IJsonWrapper.cs.meta
|
|
40
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonData.cs
|
|
41
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonData.cs.meta
|
|
42
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonException.cs
|
|
43
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonException.cs.meta
|
|
44
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMapper.cs
|
|
45
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMapper.cs.meta
|
|
46
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMockWrapper.cs
|
|
47
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonMockWrapper.cs.meta
|
|
48
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonReader.cs
|
|
49
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonReader.cs.meta
|
|
50
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonWriter.cs
|
|
51
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/JsonWriter.cs.meta
|
|
52
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Lexer.cs
|
|
53
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Lexer.cs.meta
|
|
54
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Netstandard15Polyfill.cs
|
|
55
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/Netstandard15Polyfill.cs.meta
|
|
56
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/ParserToken.cs
|
|
57
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/ParserToken.cs.meta
|
|
58
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/StarkLitJson.asmdef
|
|
59
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/LitJson/StarkLitJson.asmdef.meta
|
|
60
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Resources/ContainerConfig.json
|
|
61
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/Resources/ContainerConfig.json.meta
|
|
62
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem.meta
|
|
63
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkCallbackHandler.cs
|
|
64
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkCallbackHandler.cs.meta
|
|
65
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkModel.cs
|
|
66
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkModel.cs.meta
|
|
67
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkSDK.jslib
|
|
68
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkSDK.jslib.meta
|
|
69
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkStorageManager.cs
|
|
70
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkStorageManager.cs.meta
|
|
71
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGL.asmdef
|
|
72
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGL.asmdef.meta
|
|
73
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGLInterface.cs
|
|
74
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/StarkWebGLInterface.cs.meta
|
|
75
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/UNBridge.jslib
|
|
76
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/UNBridge.jslib.meta
|
|
77
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManager.cs
|
|
78
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManager.cs.meta
|
|
79
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerDefault.cs
|
|
80
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerDefault.cs.meta
|
|
81
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerWebGL.cs
|
|
82
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk/WebGL/FileSystem/StarkFileSystemManagerWebGL.cs.meta
|
|
83
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor.meta
|
|
84
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/package.json
|
|
85
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/package.json.meta
|
|
86
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Tools.meta
|
|
87
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll
|
|
88
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Editor/starksdk_tools.dll.meta
|
|
89
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Tools/dummy.py
|
|
90
|
+
Assets/Plugins/ByteGame/com.bytedance.starksdk.unitytools/Tools/dummy.py.meta
|
|
91
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin
|
|
92
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinBannerAd.cs
|
|
93
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinBannerAd.cs.meta
|
|
94
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinSdk.cs
|
|
95
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/DouyinSdk.cs.meta
|
|
96
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor.meta
|
|
97
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Resources.meta
|
|
98
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinAndroid.cs
|
|
99
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinAndroid.cs.meta
|
|
100
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinIOS.cs
|
|
101
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Editor/PublishDouyinIOS.cs.meta
|
|
102
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Resources/TYPHOON_SDK_DOUYIN_MINI.prefab
|
|
103
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/Douyin/Resources/TYPHOON_SDK_DOUYIN_MINI.prefab.meta
|
|
Binary file
|
|
@@ -381,6 +381,8 @@ Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini
|
|
|
381
381
|
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/Editor.meta
|
|
382
382
|
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/Plugins.meta
|
|
383
383
|
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/Resources.meta
|
|
384
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/UnityToJs.cs
|
|
385
|
+
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/UnityToJs.cs.meta
|
|
384
386
|
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/WxMiniSdk.cs
|
|
385
387
|
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/WxMiniSdk.cs.meta
|
|
386
388
|
Assets/Typhoon_Gen/TyphoonSDK/Runtime/WxMini/Editor/PublishWxMini.cs
|
|
Binary file
|
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.23","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"}}
|