com.typhoon.unitysdk 1.0.43 → 1.0.45
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 +4 -1
- package/Editor/ApplyTool.cs +1 -1
- package/Editor/DouyinConfig.cs +13 -8
- package/Editor/GUIDrawer.cs +4 -1
- package/Editor/Preferences.cs +1 -1
- package/Editor/PublishWindow.cs +5 -5
- package/Editor/UniEditor.cs +3 -3
- package/Editor/WxMiniConfig.cs +4 -3
- package/Editor/doc/changelog.md +2 -0
- package/Editor/doc/changelog.md.meta +7 -0
- package/Editor/doc.meta +8 -0
- package/Runtime/BaseSdk.cs +9 -0
- package/Runtime/Interface.cs +10 -1
- package/Runtime/KvMap.cs +13 -0
- package/Runtime/KvMap.cs.meta +11 -0
- package/Runtime/SdkDebug.cs +9 -0
- package/Runtime/SdkLite.cs +72 -3
- package/Runtime/SdkTestInUnity.cs +7 -5
- package/Runtime/SimulateOnShow.cs +30 -0
- package/Runtime/SimulateOnShow.cs.meta +11 -0
- package/Sources~/Package/Douyin.unitypackage +0 -0
- package/Sources~/Package/VivoMini.unitypackage +0 -0
- package/Sources~/Package/WxMini.unitypackage +0 -0
- package/package.json +1 -1
|
@@ -228,8 +228,11 @@ namespace TyphoonUnitySDK
|
|
|
228
228
|
// AddressableAssetSettings.CleanPlayerContent(builder as IDataBuilder);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
Debug.Log(
|
|
231
|
+
Debug.Log(
|
|
232
|
+
$"<color=#{SdkDebug.BlueHex}>使用profile:{settings.profileSettings.GetProfileName(profileId)}</color>");
|
|
232
233
|
|
|
234
|
+
Debug.Log(
|
|
235
|
+
$"<color=#{SdkDebug.BlueHex}>想要在AA构建前or后做点事情?任意Editor文件夹下创建class继承于TyphoonUnitySDK.OnBuildAAProcessor</color>");
|
|
233
236
|
//触发AA回调
|
|
234
237
|
var sub = GetSubClassTypes(typeof(OnBuildAAProcessor));
|
|
235
238
|
var match = new List<OnBuildAAProcessor>();
|
package/Editor/ApplyTool.cs
CHANGED
|
@@ -89,7 +89,7 @@ namespace TyphoonUnitySDK
|
|
|
89
89
|
|
|
90
90
|
match.Apply(setting);
|
|
91
91
|
InvokeOnApplyEnd(setting);
|
|
92
|
-
Debug.Log($"<color=#
|
|
92
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>想在应用前or后做点事情?任意Editor文件夹下创建class继承TyphoonUnitySDK.OnApplyProcessor实现接口</color>");
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
package/Editor/DouyinConfig.cs
CHANGED
|
@@ -52,17 +52,22 @@ namespace TyphoonUnitySDK
|
|
|
52
52
|
var tmpEnable = GUI.enabled;
|
|
53
53
|
GUI.enabled = true;
|
|
54
54
|
GUILayout.Space(6);
|
|
55
|
-
GUIDrawer.DrawKeynotes("①仅支持Unity版本:2019.4.35(逐步放弃),2021.3.14(最优,支持ASTC
|
|
56
|
-
GUIDrawer.DrawKeynotes(" 详细以官方文档地址为准,链接如下:");
|
|
55
|
+
GUIDrawer.DrawKeynotes("①仅支持Unity版本:2019.4.35(逐步放弃),2021.3.14(最优,支持ASTC压缩)");
|
|
57
56
|
var url = "https://bytedance.feishu.cn/docx/doxcnTTjZHp8J6HzdrSbWu1aK5b";
|
|
58
|
-
GUIDrawer.DrawUrlLink($" {url}", () => Application.OpenURL(url));
|
|
59
|
-
GUIDrawer.DrawKeynotes("
|
|
60
|
-
GUIDrawer.DrawKeynotes("
|
|
57
|
+
GUIDrawer.DrawUrlLink($" [官方说明] {url}", () => Application.OpenURL(url));
|
|
58
|
+
GUIDrawer.DrawKeynotes("②webgl不支持多线程,修改代码进行适配 (只发Android可忽略)");
|
|
59
|
+
GUIDrawer.DrawKeynotes("③录屏分享(必须接入)");
|
|
60
|
+
url = "https://auffm1e1gb.feishu.cn/docx/QiGldaOsWom8p4xGjchcTpm5nmh#R5wFdxUELo22n7xbg7jcmI53n0f";
|
|
61
|
+
GUIDrawer.DrawUrlLink($" [API文档] {url}", () => Application.OpenURL(url));
|
|
62
|
+
GUIDrawer.DrawKeynotes("④使用指定广告图标,注意广告规范");
|
|
61
63
|
url = "https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/operation1/advertise/norms";
|
|
62
|
-
GUIDrawer.DrawUrlLink($" {url}", () => Application.OpenURL(url));
|
|
63
|
-
GUIDrawer.DrawKeynotes("
|
|
64
|
+
GUIDrawer.DrawUrlLink($" [官方说明] {url}", () => Application.OpenURL(url));
|
|
65
|
+
GUIDrawer.DrawKeynotes("⑤侧边栏复访(必须接入)");
|
|
64
66
|
url = "https://developer.open-douyin.com/docs/resource/zh-CN/mini-game/operation1/ability/-retention/sidebar#c6ed8ce0";
|
|
65
|
-
GUIDrawer.DrawUrlLink($" {url}", () => Application.OpenURL(url));
|
|
67
|
+
GUIDrawer.DrawUrlLink($" [官方说明] {url}", () => Application.OpenURL(url));
|
|
68
|
+
url = "https://auffm1e1gb.feishu.cn/docx/QiGldaOsWom8p4xGjchcTpm5nmh#K322dje8YoJ6psxM7XkcGs5zn6f";
|
|
69
|
+
GUIDrawer.DrawUrlLink($" [API文档] {url}", () => Application.OpenURL(url));
|
|
70
|
+
GUIDrawer.DrawKeynotes("⑥记得在抖音小游戏后台配置域名白名单(如果需要)");
|
|
66
71
|
GUILayout.Space(6);
|
|
67
72
|
GUI.enabled = tmpEnable;
|
|
68
73
|
return true;
|
package/Editor/GUIDrawer.cs
CHANGED
|
@@ -38,7 +38,9 @@ namespace TyphoonUnitySDK
|
|
|
38
38
|
if (_linkstyle == null)
|
|
39
39
|
{
|
|
40
40
|
_linkstyle = new GUIStyle(Styles.rlabel_italic);
|
|
41
|
-
_linkstyle.normal.textColor =
|
|
41
|
+
_linkstyle.normal.textColor = EditorGUIUtility.isProSkin
|
|
42
|
+
? new Color(0.71f, 0.27f, 0.91f, 1f)
|
|
43
|
+
: new Color(0.39f, 0.15f, 0.51f, 1f);
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
return _linkstyle;
|
|
@@ -96,6 +98,7 @@ namespace TyphoonUnitySDK
|
|
|
96
98
|
StyleTooltip.normal.textColor = EditorGUIUtility.isProSkin
|
|
97
99
|
? new Color(0.47f, 0.8f, 1f, 1f)
|
|
98
100
|
: new Color(0.04f, 0.31f, 0.57f, 1f);
|
|
101
|
+
StyleTooltip.richText = true;
|
|
99
102
|
GUILayout.TextArea(content, StyleTooltip, option);
|
|
100
103
|
}
|
|
101
104
|
|
package/Editor/Preferences.cs
CHANGED
|
@@ -27,7 +27,7 @@ namespace TyphoonUnitySDK
|
|
|
27
27
|
_instance = CreateInstance<Preferences>();
|
|
28
28
|
UniEditor.CreateDirIfNotExist(Path.GetDirectoryName(AssetPath));
|
|
29
29
|
AssetDatabase.CreateAsset(_instance, AssetPath);
|
|
30
|
-
Debug.Log($"<color=#
|
|
30
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>生成:{AssetPath}</color>");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
return _instance;
|
package/Editor/PublishWindow.cs
CHANGED
|
@@ -350,21 +350,21 @@ namespace TyphoonUnitySDK
|
|
|
350
350
|
|
|
351
351
|
if (clickApply)
|
|
352
352
|
{
|
|
353
|
-
Debug.Log($"<color=#
|
|
353
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>应用...{_select}</color>");
|
|
354
354
|
_select.Apply();
|
|
355
|
-
Debug.Log($"<color=#
|
|
355
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>应用完毕</color>");
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
if (clickBuildAA)
|
|
359
359
|
{
|
|
360
|
-
Debug.Log($"<color=#
|
|
360
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>构建AA...</color>");
|
|
361
361
|
AddressableSupport.BuildAASource(_select);
|
|
362
|
-
Debug.Log($"<color=#
|
|
362
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>构建AA结束</color>");
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
if (clickPublish)
|
|
366
366
|
{
|
|
367
|
-
Debug.Log($"<color=#
|
|
367
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>发布...</color>");
|
|
368
368
|
_select.Publish();
|
|
369
369
|
}
|
|
370
370
|
|
package/Editor/UniEditor.cs
CHANGED
|
@@ -126,7 +126,7 @@ namespace TyphoonUnitySDK
|
|
|
126
126
|
/// </summary>
|
|
127
127
|
public static void ImportPackage(string path, bool interactive = true)
|
|
128
128
|
{
|
|
129
|
-
Debug.Log($"<color=#
|
|
129
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>导入----{path}</color>");
|
|
130
130
|
AssetDatabase.ImportPackage(path, interactive);
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -172,7 +172,7 @@ namespace TyphoonUnitySDK
|
|
|
172
172
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, definesString);
|
|
173
173
|
foreach (var element in removes)
|
|
174
174
|
{
|
|
175
|
-
Debug.Log($"<color=#
|
|
175
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>移除宏定义:{element}</color>");
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -213,7 +213,7 @@ namespace TyphoonUnitySDK
|
|
|
213
213
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, definesString);
|
|
214
214
|
foreach (var element in append)
|
|
215
215
|
{
|
|
216
|
-
Debug.Log($"<color=#
|
|
216
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>添加宏定义:{element}</color>");
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
package/Editor/WxMiniConfig.cs
CHANGED
|
@@ -49,6 +49,8 @@ namespace TyphoonUnitySDK
|
|
|
49
49
|
GUILayout.Space(6);
|
|
50
50
|
GUIDrawer.DrawKeynotes("①支持Unity版本:2019,2020,2021(推荐,支持ASTC压缩,坑最少)");
|
|
51
51
|
GUIDrawer.DrawKeynotes("②为EventSystem加上WxMiniTouchInputSupport组件,用于支持多点触控");
|
|
52
|
+
GUIDrawer.DrawKeynotes("③webgl不支持多线程,修改代码进行适配");
|
|
53
|
+
GUIDrawer.DrawKeynotes("④记得在微信公众平台后台配置域名白名单(如果需要)");
|
|
52
54
|
GUILayout.Space(6);
|
|
53
55
|
GUI.enabled = tmpEnable;
|
|
54
56
|
return true;
|
|
@@ -71,9 +73,8 @@ namespace TyphoonUnitySDK
|
|
|
71
73
|
arg.CDN = EditorGUILayout.TextField("CDN地址 (后台配白名单)", arg.CDN);
|
|
72
74
|
GUILayout.EndHorizontal();
|
|
73
75
|
GUIDrawer.DrawKeynotes($"支持与自定义变量组合,[变量名]作为占位符\n最终地址:{VariablePreset.Default.ParserToString(arg.CDN)}");
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// GUILayout.Height(44));
|
|
76
|
+
GUIDrawer.DrawKeynotes(
|
|
77
|
+
$"<b>[ 注 意 ! ] </b>如果有远端资源需要动态下载,需要放在CDN地址的StreamingAssets下,参考路径:\n{VariablePreset.Default.ParserToString(arg.CDN)}/StreamingAssets/<资源文件,子目录资源文件>...\n非此地址下载的aa或ab资源不会常驻保存(每次重启游戏都会丢失,可能导致重复下载)造成CDN浪费");
|
|
77
78
|
GUILayout.Space(5);
|
|
78
79
|
return true;
|
|
79
80
|
}
|
package/Editor/doc.meta
ADDED
package/Runtime/BaseSdk.cs
CHANGED
package/Runtime/Interface.cs
CHANGED
|
@@ -7,7 +7,7 @@ namespace TyphoonUnitySDK
|
|
|
7
7
|
/// SDK全功能接口
|
|
8
8
|
/// </summary>
|
|
9
9
|
public interface ISdk : IOnCreate, IInitSdk, ILogin, IExitGame, IBannerAD, IVideoAD, IIntersAD, IFloatIconAD,
|
|
10
|
-
INativeAD, IRecordGame, IHttpGet, IHttpPost, ISideBarReturn, IShowToast
|
|
10
|
+
INativeAD, IRecordGame, IHttpGet, IHttpPost, ISideBarReturn, IShowToast,ITrack
|
|
11
11
|
{
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -202,4 +202,13 @@ namespace TyphoonUnitySDK
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
#endregion
|
|
205
|
+
|
|
206
|
+
#region 事件上报
|
|
207
|
+
|
|
208
|
+
public interface ITrack
|
|
209
|
+
{
|
|
210
|
+
void Track(string eventName, KvMap map);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
#endregion
|
|
205
214
|
}
|
package/Runtime/KvMap.cs
ADDED
package/Runtime/SdkDebug.cs
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
using UnityEngine;
|
|
2
|
+
using UnityEngine.Scripting;
|
|
2
3
|
|
|
3
4
|
namespace TyphoonUnitySDK
|
|
4
5
|
{
|
|
5
6
|
/// <summary>
|
|
6
7
|
/// SDK 日志输出
|
|
7
8
|
/// </summary>
|
|
9
|
+
[Preserve]
|
|
8
10
|
public class SdkDebug
|
|
9
11
|
{
|
|
10
12
|
public static bool IsDebug = true;
|
|
11
13
|
public static string Prefix = "##typhoon-unity-sdk:";
|
|
12
14
|
|
|
15
|
+
#if UNITY_EDITOR
|
|
16
|
+
public static string BlueHex => UnityEditor.EditorGUIUtility.isProSkin ? "26ade9" : "092415";
|
|
17
|
+
#else
|
|
18
|
+
public static string BlueHex => "26ade9";
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
13
22
|
public static void Log(string message)
|
|
14
23
|
{
|
|
15
24
|
if (!IsDebug)
|
package/Runtime/SdkLite.cs
CHANGED
|
@@ -10,6 +10,32 @@ namespace TyphoonUnitySDK
|
|
|
10
10
|
/// </summary>
|
|
11
11
|
public partial class SdkLite : MonoSingleton<SdkLite>
|
|
12
12
|
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// 生命周期回调——监听小程序启动或切前台<para/>
|
|
15
|
+
/// 初始化完成后才会触发<para/>
|
|
16
|
+
/// 支持:微信小游戏,抖音小游戏,vivo小游戏<para/>
|
|
17
|
+
/// </summary>
|
|
18
|
+
public static event Action OnShow = null;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
/// 生命周期回调——监听小程序切后台<para/>
|
|
22
|
+
/// 初始化完成后才会触发<para/>
|
|
23
|
+
/// 支持:微信小游戏,抖音小游戏,vivo小游戏<para/>
|
|
24
|
+
/// </summary>
|
|
25
|
+
public static event Action OnHide = null;
|
|
26
|
+
|
|
27
|
+
//触发OnShow
|
|
28
|
+
public static void InvokeOnShow()
|
|
29
|
+
{
|
|
30
|
+
OnShow?.Invoke();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//触发OnHide
|
|
34
|
+
public static void InvokeOnHide()
|
|
35
|
+
{
|
|
36
|
+
OnHide?.Invoke();
|
|
37
|
+
}
|
|
38
|
+
|
|
13
39
|
/*绑定SDK实例*/
|
|
14
40
|
public static Dictionary<AppChannel, string> SDKBindings = new Dictionary<AppChannel, string>
|
|
15
41
|
{
|
|
@@ -40,6 +66,7 @@ namespace TyphoonUnitySDK
|
|
|
40
66
|
}
|
|
41
67
|
}
|
|
42
68
|
|
|
69
|
+
|
|
43
70
|
protected override void Init()
|
|
44
71
|
{
|
|
45
72
|
base.Init();
|
|
@@ -53,6 +80,7 @@ namespace TyphoonUnitySDK
|
|
|
53
80
|
private void CreateSDK()
|
|
54
81
|
{
|
|
55
82
|
#if UNITY_EDITOR
|
|
83
|
+
SimulateOnShow.Instance.Build();
|
|
56
84
|
return;
|
|
57
85
|
#endif
|
|
58
86
|
if (SDKBindings.TryGetValue(AppConfig.Channel, out var match))
|
|
@@ -670,7 +698,7 @@ namespace TyphoonUnitySDK
|
|
|
670
698
|
else
|
|
671
699
|
{
|
|
672
700
|
fail?.Invoke("not support");
|
|
673
|
-
Debug.Log("<color=#
|
|
701
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}> [SDK模拟] 是否支持侧边栏-回调结果==false,可从'TyphoonSDK/模拟测试'修改</color>");
|
|
674
702
|
}
|
|
675
703
|
|
|
676
704
|
return;
|
|
@@ -708,7 +736,7 @@ namespace TyphoonUnitySDK
|
|
|
708
736
|
}
|
|
709
737
|
|
|
710
738
|
fail?.Invoke("not support");
|
|
711
|
-
Debug.Log("<color=#
|
|
739
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}> [SDK模拟] 导航到侧边栏-回调结果==false,可从'TyphoonSDK/模拟测试'修改</color>");
|
|
712
740
|
}
|
|
713
741
|
|
|
714
742
|
return;
|
|
@@ -730,7 +758,7 @@ namespace TyphoonUnitySDK
|
|
|
730
758
|
{
|
|
731
759
|
if (!SdkTestInUnity.Instance.IsEnterFromSideBar)
|
|
732
760
|
{
|
|
733
|
-
Debug.Log("<color=#
|
|
761
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}> [SDK模拟] 侧边栏进入标记==false,可从'TyphoonSDK/模拟测试'修改</color>");
|
|
734
762
|
}
|
|
735
763
|
|
|
736
764
|
return SdkTestInUnity.Instance.IsEnterFromSideBar;
|
|
@@ -761,5 +789,46 @@ namespace TyphoonUnitySDK
|
|
|
761
789
|
}
|
|
762
790
|
|
|
763
791
|
#endregion
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
#region 事件上报
|
|
795
|
+
|
|
796
|
+
/// <summary>
|
|
797
|
+
/// 多项事件上报<para/>
|
|
798
|
+
/// 为了保证各渠道兼容性,注意[事件名][字段名]都使用英文+数字的形式
|
|
799
|
+
/// </summary>
|
|
800
|
+
/// <param name="eventName">事件名</param>
|
|
801
|
+
/// <param name="map">携带的数据集合</param>
|
|
802
|
+
public virtual void Track(string eventName, KvMap map)
|
|
803
|
+
{
|
|
804
|
+
#if UNITY_EDITOR
|
|
805
|
+
if (SdkTestInUnity.Instance.TrackLogFlag)
|
|
806
|
+
{
|
|
807
|
+
//开启日志
|
|
808
|
+
Debug.Log(
|
|
809
|
+
$"<color=#{SdkDebug.BlueHex}> [SDK模拟] Track [eventName]:{eventName} [map]:{map.ToXJson()} 可从'TyphoonSDK/模拟测试'中修改</color>");
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
return;
|
|
813
|
+
#endif
|
|
814
|
+
_sdk.Track(eventName, map);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/// <summary>
|
|
818
|
+
/// 单项事件上报<para/>
|
|
819
|
+
/// </summary>
|
|
820
|
+
/// <param name="eventName">事件名</param>
|
|
821
|
+
/// <param name="field">字段名</param>
|
|
822
|
+
/// <param name="value">携带的数据(可为空)</param>
|
|
823
|
+
public virtual void Track(string eventName, string field, object value = null)
|
|
824
|
+
{
|
|
825
|
+
var map = new KvMap()
|
|
826
|
+
{
|
|
827
|
+
{ field, value }
|
|
828
|
+
};
|
|
829
|
+
Track(eventName, map);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
#endregion
|
|
764
833
|
}
|
|
765
834
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
using System.IO;
|
|
2
2
|
using TyphoonUnitySDK;
|
|
3
|
-
|
|
3
|
+
using UnityEngine;
|
|
4
4
|
#if UNITY_EDITOR
|
|
5
5
|
using UnityEditor;
|
|
6
6
|
#endif
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
using UnityEngine.Serialization;
|
|
9
7
|
|
|
10
8
|
public class SdkTestInUnity : ScriptableObject
|
|
11
9
|
{
|
|
@@ -18,13 +16,17 @@ public class SdkTestInUnity : ScriptableObject
|
|
|
18
16
|
[LabelOverride("视频广告flag")] public bool GetVideoFlagResult = true;
|
|
19
17
|
[LabelOverride("视频广告回调")] public bool ShowVideoResult = true;
|
|
20
18
|
|
|
21
|
-
[
|
|
19
|
+
[LabelOverride("模拟小游戏端onShow,onHide")] public bool SimulateInvokeOnShow = true;
|
|
20
|
+
|
|
21
|
+
[Header("抖音小游戏相关")] [LabelOverride("是否支持侧边栏-回调结果")]
|
|
22
22
|
public bool IsSupportSideBarResult = true;
|
|
23
23
|
|
|
24
24
|
[LabelOverride("导航到侧边栏-回调结果")] public bool NavigateToSideBarResult = true;
|
|
25
25
|
|
|
26
26
|
[LabelOverride("侧边栏进入标记")] public bool IsEnterFromSideBar = true;
|
|
27
27
|
|
|
28
|
+
[LabelOverride("事件上报Log")] public bool TrackLogFlag = true;
|
|
29
|
+
|
|
28
30
|
|
|
29
31
|
private static SdkTestInUnity _instance = null;
|
|
30
32
|
|
|
@@ -38,7 +40,7 @@ public class SdkTestInUnity : ScriptableObject
|
|
|
38
40
|
_instance = AssetDatabase.LoadAssetAtPath<SdkTestInUnity>(ASSET_PATH);
|
|
39
41
|
if (_instance == null)
|
|
40
42
|
{
|
|
41
|
-
_instance =
|
|
43
|
+
_instance = CreateInstance<SdkTestInUnity>();
|
|
42
44
|
var folder = Path.GetDirectoryName(ASSET_PATH);
|
|
43
45
|
if (!Directory.Exists(folder))
|
|
44
46
|
{
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace TyphoonUnitySDK
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// 模拟小游戏端onShow,onHide
|
|
8
|
+
/// </summary>
|
|
9
|
+
public class SimulateOnShow : MonoSingleton<SimulateOnShow>
|
|
10
|
+
{
|
|
11
|
+
#if UNITY_EDITOR
|
|
12
|
+
private void OnApplicationFocus(bool hasFocus)
|
|
13
|
+
{
|
|
14
|
+
if (SdkTestInUnity.Instance.SimulateInvokeOnShow)
|
|
15
|
+
{
|
|
16
|
+
if (hasFocus)
|
|
17
|
+
{
|
|
18
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>[SDK模拟]onShow 可从'TyphoonSDK/模拟测试'修改</color>");
|
|
19
|
+
SdkLite.InvokeOnShow();
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
{
|
|
23
|
+
Debug.Log($"<color=#{SdkDebug.BlueHex}>[SDK模拟]onHide 可从'TyphoonSDK/模拟测试'修改</color>");
|
|
24
|
+
SdkLite.InvokeOnHide();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
#endif
|
|
29
|
+
}
|
|
30
|
+
}
|
|
Binary file
|
|
Binary file
|
|
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.45","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
|