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,407 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TyphoonUnitySDK
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Typhoon SDK
|
|
9
|
+
/// </summary>
|
|
10
|
+
public partial class TyphoonSdk : MonoSingleton<TyphoonSdk>
|
|
11
|
+
{
|
|
12
|
+
public static Dictionary<AppChannel, string> SDKBindings = new Dictionary<AppChannel, string>
|
|
13
|
+
{
|
|
14
|
+
{ AppChannel.Test, "TYPHOON_SDK_TEST" }, //测试渠道
|
|
15
|
+
{ AppChannel.ChinaAndroid, "TYPHOON_SDK_CHINA_ANDROID" }, //国内安卓
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
public static bool InUnity = false;
|
|
19
|
+
private ISdk _sdk;
|
|
20
|
+
|
|
21
|
+
protected override void Init()
|
|
22
|
+
{
|
|
23
|
+
base.Init();
|
|
24
|
+
#if UNITY_EDITOR
|
|
25
|
+
InUnity = true;
|
|
26
|
+
#endif
|
|
27
|
+
DontDestroyOnLoad(gameObject);
|
|
28
|
+
//构建SDK实例
|
|
29
|
+
CreateSDK();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#region 创建SDK实例
|
|
33
|
+
|
|
34
|
+
private void CreateSDK()
|
|
35
|
+
{
|
|
36
|
+
if (SDKBindings.TryGetValue(AppConfig.Channel, out var match))
|
|
37
|
+
{
|
|
38
|
+
var source = Resources.Load<GameObject>(match);
|
|
39
|
+
var clone = Instantiate(source);
|
|
40
|
+
_sdk = clone.GetComponent<BaseSdk>();
|
|
41
|
+
DontDestroyOnLoad(clone);
|
|
42
|
+
_sdk.OnCreate();
|
|
43
|
+
}
|
|
44
|
+
else
|
|
45
|
+
{
|
|
46
|
+
throw new Exception($"未处理的类型:{AppConfig.Channel}");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#endregion
|
|
51
|
+
|
|
52
|
+
#region 初始化SDK
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
/// 初始化sdk
|
|
56
|
+
/// </summary>
|
|
57
|
+
public void InitSdk(Action success, Action<string> fail)
|
|
58
|
+
{
|
|
59
|
+
Log("InitSdk");
|
|
60
|
+
if (InUnity)
|
|
61
|
+
{
|
|
62
|
+
//直接成功
|
|
63
|
+
success?.Invoke();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
_sdk.InitSdk(success, fail);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#endregion
|
|
71
|
+
|
|
72
|
+
#region 登录
|
|
73
|
+
|
|
74
|
+
/// <summary>
|
|
75
|
+
/// 登录
|
|
76
|
+
/// </summary>
|
|
77
|
+
public void Login(Action success, Action<string> fail)
|
|
78
|
+
{
|
|
79
|
+
Log("Login");
|
|
80
|
+
if (InUnity)
|
|
81
|
+
{
|
|
82
|
+
if (SdkTestInUnity.Instance.LoginResult)
|
|
83
|
+
{
|
|
84
|
+
success?.Invoke();
|
|
85
|
+
}
|
|
86
|
+
else
|
|
87
|
+
{
|
|
88
|
+
fail?.Invoke("test in unity login result false ");
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
_sdk.Login(success, fail);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#endregion
|
|
98
|
+
|
|
99
|
+
#region 退出游戏
|
|
100
|
+
|
|
101
|
+
/// <summary>
|
|
102
|
+
/// 是否支持退出游戏
|
|
103
|
+
/// </summary>
|
|
104
|
+
public bool IsSupportExitGame()
|
|
105
|
+
{
|
|
106
|
+
if (InUnity)
|
|
107
|
+
{
|
|
108
|
+
return SdkTestInUnity.Instance.IsSupportExitGame;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return _sdk.IsSupportExitGame();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/// <summary>
|
|
115
|
+
/// 退出游戏
|
|
116
|
+
/// </summary>
|
|
117
|
+
public void ExitGame()
|
|
118
|
+
{
|
|
119
|
+
Log("ExitGame");
|
|
120
|
+
if (InUnity)
|
|
121
|
+
{
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (IsSupportExitGame())
|
|
126
|
+
{
|
|
127
|
+
_sdk.ExitGame();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
#endregion
|
|
132
|
+
|
|
133
|
+
#region 日志
|
|
134
|
+
|
|
135
|
+
private void Log(string log)
|
|
136
|
+
{
|
|
137
|
+
SdkDebug.Log(log);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#endregion
|
|
141
|
+
|
|
142
|
+
#region 视频广告
|
|
143
|
+
|
|
144
|
+
/// <summary>
|
|
145
|
+
/// 视频广告
|
|
146
|
+
/// </summary>
|
|
147
|
+
/// <param name="scene">广告场景</param>
|
|
148
|
+
/// <param name="success">成功回调,发放奖励</param>
|
|
149
|
+
/// <param name="fail">失败回调,返回失败原因</param>
|
|
150
|
+
public void ShowVideo(string scene, Action success, Action<string> fail)
|
|
151
|
+
{
|
|
152
|
+
Log($"ShowVideo:{scene}");
|
|
153
|
+
if (InUnity)
|
|
154
|
+
{
|
|
155
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
156
|
+
{
|
|
157
|
+
SDKInteractiveUI.Instance.ShowVideo(success, fail);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
//弹窗提示Unity广告
|
|
162
|
+
if (SdkTestInUnity.Instance.ShowVideoResult)
|
|
163
|
+
{
|
|
164
|
+
success?.Invoke();
|
|
165
|
+
}
|
|
166
|
+
else
|
|
167
|
+
{
|
|
168
|
+
fail?.Invoke("test result fail");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
_sdk.ShowVideo(scene, success, fail);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
#endregion
|
|
178
|
+
|
|
179
|
+
#region 插页广告
|
|
180
|
+
|
|
181
|
+
/// <summary>
|
|
182
|
+
/// 插页广告
|
|
183
|
+
/// </summary>
|
|
184
|
+
/// <param name="scene">广告场景</param>
|
|
185
|
+
public void ShowInters(string scene)
|
|
186
|
+
{
|
|
187
|
+
Log($"ShowInters:{scene}");
|
|
188
|
+
if (InUnity)
|
|
189
|
+
{
|
|
190
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
191
|
+
{
|
|
192
|
+
SDKInteractiveUI.Instance.ShowInters();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
_sdk.ShowInters(scene);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#endregion
|
|
203
|
+
|
|
204
|
+
#region Banner
|
|
205
|
+
|
|
206
|
+
/// <summary>
|
|
207
|
+
/// 展示banner
|
|
208
|
+
/// </summary>
|
|
209
|
+
/// <param name="scene">广告场景</param>
|
|
210
|
+
/// <param name="position">banner位置</param>
|
|
211
|
+
public void ShowBanner(string scene, BannerPosition position)
|
|
212
|
+
{
|
|
213
|
+
if (InUnity)
|
|
214
|
+
{
|
|
215
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
216
|
+
{
|
|
217
|
+
SDKInteractiveUI.Instance.ShowBanner(position);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
_sdk.ShowBanner(scene, position);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/// <summary>
|
|
228
|
+
/// 隐藏banner
|
|
229
|
+
/// </summary>
|
|
230
|
+
/// <param name="scene"></param>
|
|
231
|
+
public void HideBanner(string scene)
|
|
232
|
+
{
|
|
233
|
+
if (InUnity)
|
|
234
|
+
{
|
|
235
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
236
|
+
{
|
|
237
|
+
SDKInteractiveUI.Instance.HideBanner();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
_sdk.HideBanner(scene);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
#endregion
|
|
247
|
+
|
|
248
|
+
#region 原生广告
|
|
249
|
+
|
|
250
|
+
/// <summary>
|
|
251
|
+
/// 展示原生广告
|
|
252
|
+
/// </summary>
|
|
253
|
+
/// <param name="scene">广告场景</param>
|
|
254
|
+
public void ShowNative(string scene)
|
|
255
|
+
{
|
|
256
|
+
if (InUnity)
|
|
257
|
+
{
|
|
258
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
259
|
+
{
|
|
260
|
+
SDKInteractiveUI.Instance.ShowNative();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
_sdk.ShowNative(scene);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/// <summary>
|
|
270
|
+
/// 隐藏原生广告
|
|
271
|
+
/// </summary>
|
|
272
|
+
/// <param name="scene">广告场景</param>
|
|
273
|
+
public void HideNative(string scene)
|
|
274
|
+
{
|
|
275
|
+
if (InUnity)
|
|
276
|
+
{
|
|
277
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
278
|
+
{
|
|
279
|
+
SDKInteractiveUI.Instance.HideNative();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
_sdk.HideNative(scene);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
#endregion
|
|
289
|
+
|
|
290
|
+
#region 悬浮Icon
|
|
291
|
+
|
|
292
|
+
/// <summary>
|
|
293
|
+
/// 展示悬浮ICON
|
|
294
|
+
/// </summary>
|
|
295
|
+
/// <param name="scene">广告场景</param>
|
|
296
|
+
/// <param name="spx">屏幕百分比X(左上角)</param>
|
|
297
|
+
/// <param name="spy">屏幕百分比Y(左上角)</param>
|
|
298
|
+
public void ShowFloatIcon(string scene, float spx, float spy)
|
|
299
|
+
{
|
|
300
|
+
if (InUnity)
|
|
301
|
+
{
|
|
302
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
303
|
+
{
|
|
304
|
+
SDKInteractiveUI.Instance.ShowFlatIcon(scene, spx, spy);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
_sdk.ShowFloatIcon(scene, spx, spy);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/// <summary>
|
|
314
|
+
/// 隐藏悬浮ICON
|
|
315
|
+
/// </summary>
|
|
316
|
+
/// <param name="scene">广告场景</param>
|
|
317
|
+
public void HideFloatIcon(string scene)
|
|
318
|
+
{
|
|
319
|
+
if (InUnity)
|
|
320
|
+
{
|
|
321
|
+
if (SdkTestInUnity.Instance.OpenInteractive)
|
|
322
|
+
{
|
|
323
|
+
SDKInteractiveUI.Instance.HideFloatIcon(scene);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
_sdk.HideFloatIcon(scene);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
#endregion
|
|
333
|
+
|
|
334
|
+
#region 发布版本号
|
|
335
|
+
|
|
336
|
+
/// <summary>
|
|
337
|
+
/// 发布版本号
|
|
338
|
+
/// </summary>
|
|
339
|
+
/*获取发布版本号信息*/
|
|
340
|
+
public virtual string GetPublishVersion()
|
|
341
|
+
{
|
|
342
|
+
var result = AppConfig.Version;
|
|
343
|
+
result += "_";
|
|
344
|
+
switch (AppConfig.Channel)
|
|
345
|
+
{
|
|
346
|
+
case AppChannel.ChinaAndroid:
|
|
347
|
+
result += "ca";
|
|
348
|
+
break;
|
|
349
|
+
case AppChannel.ChinaIOS:
|
|
350
|
+
result += "ci";
|
|
351
|
+
break;
|
|
352
|
+
case AppChannel.GooglePlay:
|
|
353
|
+
result += "g";
|
|
354
|
+
break;
|
|
355
|
+
case AppChannel.SeaIOS:
|
|
356
|
+
result += "si";
|
|
357
|
+
break;
|
|
358
|
+
case AppChannel.DouyinAndroid:
|
|
359
|
+
result += "da";
|
|
360
|
+
break;
|
|
361
|
+
case AppChannel.DouyinIOS:
|
|
362
|
+
result += "di";
|
|
363
|
+
break;
|
|
364
|
+
case AppChannel.WxMini:
|
|
365
|
+
result += "wm";
|
|
366
|
+
break;
|
|
367
|
+
case AppChannel.VivoMini:
|
|
368
|
+
result += "vm";
|
|
369
|
+
break;
|
|
370
|
+
case AppChannel.OppoMini:
|
|
371
|
+
result += "om";
|
|
372
|
+
break;
|
|
373
|
+
default:
|
|
374
|
+
result += "#";
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
result += $"_{AppConfig.PublishTime}";
|
|
379
|
+
|
|
380
|
+
switch (AppConfig.VersionType)
|
|
381
|
+
{
|
|
382
|
+
case VersionType.Base:
|
|
383
|
+
result += "_base";
|
|
384
|
+
break;
|
|
385
|
+
case VersionType.Alpha:
|
|
386
|
+
result += "_alpha";
|
|
387
|
+
break;
|
|
388
|
+
case VersionType.Beta:
|
|
389
|
+
result += "_beta";
|
|
390
|
+
break;
|
|
391
|
+
case VersionType.RC:
|
|
392
|
+
result += "_rc";
|
|
393
|
+
break;
|
|
394
|
+
case VersionType.Release:
|
|
395
|
+
result += "_r";
|
|
396
|
+
break;
|
|
397
|
+
default:
|
|
398
|
+
result += "#";
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return result;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
#endregion
|
|
406
|
+
}
|
|
407
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
using Newtonsoft.Json.Linq;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace TyphoonUnitySDK
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// sdk 回调
|
|
8
|
+
/// </summary>
|
|
9
|
+
public class TyphoonSdkCallback : MonoBehaviour
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// 创建SDK回调
|
|
13
|
+
/// </summary>
|
|
14
|
+
public static TyphoonSdkCallback CreateInstance()
|
|
15
|
+
{
|
|
16
|
+
var clone = new GameObject();
|
|
17
|
+
return clone.AddComponent<TyphoonSdkCallback>();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
public void Initialize()
|
|
22
|
+
{
|
|
23
|
+
SdkDebug.Log("TyphoonSdkCallback Initialize");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/*处理session消息*/
|
|
28
|
+
public void OnReceiveSessionCallback(string json)
|
|
29
|
+
{
|
|
30
|
+
SdkDebug.Log($"OnReceiveSessionCallback {json}");
|
|
31
|
+
var jObject = JObject.Parse(json);
|
|
32
|
+
var sessionId = jObject["sessionId"].ToLong();
|
|
33
|
+
var data = jObject["data"]?.ToObject<string>();
|
|
34
|
+
SessionItem.Invoke(sessionId, data);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public void Update()
|
|
38
|
+
{
|
|
39
|
+
if (Input.GetKeyDown(KeyCode.Escape))
|
|
40
|
+
{
|
|
41
|
+
if (TyphoonSdk.Instance.IsSupportExitGame())
|
|
42
|
+
{
|
|
43
|
+
TyphoonSdk.Instance.ExitGame();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
namespace TyphoonUnitySDK
|
|
2
|
+
{
|
|
3
|
+
/// <summary>
|
|
4
|
+
/// 版本类型
|
|
5
|
+
/// </summary>
|
|
6
|
+
public enum VersionType
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// 基础版本
|
|
10
|
+
/// </summary>
|
|
11
|
+
Base,
|
|
12
|
+
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// 也叫α版,此版本主要是以实现软件功能为主,通常只在软件开发者内部交流,一般而言,该版本软件的Bug较多,需要继续修改。
|
|
15
|
+
/// </summary>
|
|
16
|
+
Alpha,
|
|
17
|
+
|
|
18
|
+
/// <summary>
|
|
19
|
+
/// 此版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几,测试人员基本通过的版本。
|
|
20
|
+
/// </summary>
|
|
21
|
+
Beta,
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
/// 此版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几,测试人员基本通过的版本。
|
|
25
|
+
/// </summary>
|
|
26
|
+
RC,
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
/// 此版本意味着“最终版本”、“上线版本”,,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号(R)。
|
|
30
|
+
/// </summary>
|
|
31
|
+
Release,
|
|
32
|
+
}
|
|
33
|
+
}
|
package/Runtime.meta
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="com.typhoon.unity_launcher">
|
|
4
|
+
<application
|
|
5
|
+
android:icon="@mipmap/app_icon"
|
|
6
|
+
android:label="@string/app_name">
|
|
7
|
+
<activity
|
|
8
|
+
android:name="com.typhoon.unity_launcher.SplashActivity"
|
|
9
|
+
android:exported="true"
|
|
10
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
11
|
+
>
|
|
12
|
+
<intent-filter>
|
|
13
|
+
<action android:name="android.intent.action.MAIN" />
|
|
14
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
15
|
+
</intent-filter>
|
|
16
|
+
</activity>
|
|
17
|
+
</application>
|
|
18
|
+
</manifest>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 5f94d89077b170a4381c90f201c26655
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Android: Android
|
|
16
|
+
second:
|
|
17
|
+
enabled: 1
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Any:
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings: {}
|
|
24
|
+
- first:
|
|
25
|
+
Editor: Editor
|
|
26
|
+
second:
|
|
27
|
+
enabled: 0
|
|
28
|
+
settings:
|
|
29
|
+
DefaultValueInitialized: true
|
|
30
|
+
userData:
|
|
31
|
+
assetBundleName:
|
|
32
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 3e00c1a6fc73e2b48860f75842aa381e
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Android: Android
|
|
16
|
+
second:
|
|
17
|
+
enabled: 1
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Any:
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings: {}
|
|
24
|
+
- first:
|
|
25
|
+
Editor: Editor
|
|
26
|
+
second:
|
|
27
|
+
enabled: 0
|
|
28
|
+
settings:
|
|
29
|
+
DefaultValueInitialized: true
|
|
30
|
+
userData:
|
|
31
|
+
assetBundleName:
|
|
32
|
+
assetBundleVariant:
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: ab28817e8c6ab0947a6b8454f8e576da
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Android: Android
|
|
16
|
+
second:
|
|
17
|
+
enabled: 1
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Any:
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings: {}
|
|
24
|
+
- first:
|
|
25
|
+
Editor: Editor
|
|
26
|
+
second:
|
|
27
|
+
enabled: 0
|
|
28
|
+
settings:
|
|
29
|
+
DefaultValueInitialized: true
|
|
30
|
+
userData:
|
|
31
|
+
assetBundleName:
|
|
32
|
+
assetBundleVariant:
|