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,28 @@
|
|
|
1
|
+
namespace TyphoonUnitySDK
|
|
2
|
+
{
|
|
3
|
+
/// <summary>
|
|
4
|
+
/// AppConfig
|
|
5
|
+
/// </summary>
|
|
6
|
+
public class AppConfig
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// 渠道号
|
|
10
|
+
/// </summary>
|
|
11
|
+
public static AppChannel Channel => AppConfigAsset.Instance.Channel;
|
|
12
|
+
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// 版本类型
|
|
15
|
+
/// </summary>
|
|
16
|
+
public static VersionType VersionType => AppConfigAsset.Instance.VersionType;
|
|
17
|
+
|
|
18
|
+
/// <summary>
|
|
19
|
+
/// 版本号
|
|
20
|
+
/// </summary>
|
|
21
|
+
public static string Version => AppConfigAsset.Instance.Version;
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
/// 发布时间
|
|
25
|
+
/// </summary>
|
|
26
|
+
public static string PublishTime => AppConfigAsset.Instance.PublishTime;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
using System.IO;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using UnityEngine.Serialization;
|
|
5
|
+
|
|
6
|
+
namespace TyphoonUnitySDK
|
|
7
|
+
{
|
|
8
|
+
public partial class AppConfigAsset : ScriptableObject
|
|
9
|
+
{
|
|
10
|
+
private static AppConfigAsset _instance;
|
|
11
|
+
|
|
12
|
+
public static AppConfigAsset Instance
|
|
13
|
+
{
|
|
14
|
+
get
|
|
15
|
+
{
|
|
16
|
+
if (_instance == null)
|
|
17
|
+
{
|
|
18
|
+
_instance = Resources.Load<AppConfigAsset>("TyphoonSDK_AppConfig");
|
|
19
|
+
}
|
|
20
|
+
#if UNITY_EDITOR
|
|
21
|
+
if (_instance == null)
|
|
22
|
+
{
|
|
23
|
+
_instance = CreateInstance<AppConfigAsset>();
|
|
24
|
+
var path = "Assets/Typhoon_Gen/TyphoonSDK/Resources/TyphoonSDK_AppConfig.asset";
|
|
25
|
+
var dir = Path.GetDirectoryName(path);
|
|
26
|
+
if (!Directory.Exists(dir))
|
|
27
|
+
{
|
|
28
|
+
Directory.CreateDirectory(dir);
|
|
29
|
+
AssetDatabase.Refresh();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
AssetDatabase.CreateAsset(_instance, path);
|
|
33
|
+
AssetDatabase.Refresh();
|
|
34
|
+
AssetDatabase.SaveAssets();
|
|
35
|
+
}
|
|
36
|
+
#endif
|
|
37
|
+
return _instance;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[Tooltip("渠道")] public AppChannel Channel = AppChannel.Test;
|
|
42
|
+
|
|
43
|
+
[Tooltip("版本号")] public string Version = "1.0.0";
|
|
44
|
+
|
|
45
|
+
[Tooltip("版本类型")] public VersionType VersionType = VersionType.Release;
|
|
46
|
+
|
|
47
|
+
[FormerlySerializedAs("PublishTimeString")] [Tooltip("发布时间")]
|
|
48
|
+
public string PublishTime = "19700101000000";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace TyphoonUnitySDK
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// 默认sdk实现
|
|
8
|
+
/// </summary>
|
|
9
|
+
public abstract class BaseSdk : MonoBehaviour, ISdk
|
|
10
|
+
{
|
|
11
|
+
/*OnCreate*/
|
|
12
|
+
public abstract void OnCreate();
|
|
13
|
+
|
|
14
|
+
/*初始化SDK*/
|
|
15
|
+
public abstract void InitSdk(Action success, Action<string> fail);
|
|
16
|
+
|
|
17
|
+
/*登录*/
|
|
18
|
+
public abstract void Login(Action success, Action<string> fail);
|
|
19
|
+
|
|
20
|
+
/*是否支持退出游戏*/
|
|
21
|
+
public virtual bool IsSupportExitGame()
|
|
22
|
+
{
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/*退出游戏*/
|
|
27
|
+
public virtual void ExitGame()
|
|
28
|
+
{
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*展示banner*/
|
|
32
|
+
public virtual void ShowBanner(string scene, BannerPosition position)
|
|
33
|
+
{
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*隐藏banner*/
|
|
37
|
+
public virtual void HideBanner(string scene)
|
|
38
|
+
{
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*展示视频广告*/
|
|
42
|
+
public virtual void ShowVideo(string scene, Action success, Action<string> fail)
|
|
43
|
+
{
|
|
44
|
+
success?.Invoke();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*展示插页*/
|
|
48
|
+
public virtual void ShowInters(string scene)
|
|
49
|
+
{
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/*展示悬浮ICON*/
|
|
53
|
+
public virtual void ShowFloatIcon(string scene, float screenXP, float screenYP)
|
|
54
|
+
{
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*隐藏悬浮ICON*/
|
|
58
|
+
public virtual void HideFloatIcon(string scene)
|
|
59
|
+
{
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/*展示原生广告*/
|
|
63
|
+
public virtual void ShowNative(string scene)
|
|
64
|
+
{
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/*隐藏原生广告*/
|
|
68
|
+
public virtual void HideNative(string scene)
|
|
69
|
+
{
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/*打印日志*/
|
|
73
|
+
protected void Log(string log)
|
|
74
|
+
{
|
|
75
|
+
SdkDebug.Log(log);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
using Newtonsoft.Json;
|
|
2
|
+
|
|
3
|
+
namespace TyphoonUnitySDK
|
|
4
|
+
{
|
|
5
|
+
/// <summary>
|
|
6
|
+
/// 拓展
|
|
7
|
+
/// </summary>
|
|
8
|
+
public static partial class Extension
|
|
9
|
+
{
|
|
10
|
+
public static T ToObject<T>(this string json)
|
|
11
|
+
{
|
|
12
|
+
return JsonConvert.DeserializeObject<T>(json);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public static string ToJson(this object obj)
|
|
16
|
+
{
|
|
17
|
+
var json = JsonConvert.SerializeObject(obj);
|
|
18
|
+
return json;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static SimpleMap ToSimpleMap(this string json)
|
|
22
|
+
{
|
|
23
|
+
return JsonConvert.DeserializeObject<SimpleMap>(json);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
public static int ToInt(this object obj)
|
|
28
|
+
{
|
|
29
|
+
return int.Parse(obj.ToString());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
public static float ToFloat(this object obj)
|
|
34
|
+
{
|
|
35
|
+
return float.Parse(obj.ToString());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static long ToLong(this object obj)
|
|
39
|
+
{
|
|
40
|
+
return long.Parse(obj.ToString());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static double ToDouble(this object obj)
|
|
44
|
+
{
|
|
45
|
+
return double.Parse(obj.ToString());
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static bool ToBoolean(this object obj)
|
|
49
|
+
{
|
|
50
|
+
if (obj.ToString() == "1")
|
|
51
|
+
{
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return bool.Parse(obj.ToString());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace TyphoonUnitySDK
|
|
4
|
+
{
|
|
5
|
+
/// <summary>s
|
|
6
|
+
/// SDK全功能接口
|
|
7
|
+
/// </summary>
|
|
8
|
+
public interface ISdk : IOnCreate, IInitSdk, ILogin, IExitGame, IBannerAD, IVideoAD, IIntersAD, IFloatIconAD,
|
|
9
|
+
INativeAD
|
|
10
|
+
{
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#region 创建时
|
|
14
|
+
|
|
15
|
+
public interface IOnCreate
|
|
16
|
+
{
|
|
17
|
+
void OnCreate();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#endregion
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#region 初始化
|
|
24
|
+
|
|
25
|
+
public interface IInitSdk
|
|
26
|
+
{
|
|
27
|
+
void InitSdk(Action success, Action<string> fail);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#endregion
|
|
31
|
+
|
|
32
|
+
#region 登录
|
|
33
|
+
|
|
34
|
+
public interface ILogin
|
|
35
|
+
{
|
|
36
|
+
void Login(Action success, Action<string> fail);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#endregion
|
|
40
|
+
|
|
41
|
+
#region 退出游戏
|
|
42
|
+
|
|
43
|
+
public interface IExitGame
|
|
44
|
+
{
|
|
45
|
+
/*是否支持退出*/
|
|
46
|
+
bool IsSupportExitGame();
|
|
47
|
+
|
|
48
|
+
/*退出游戏*/
|
|
49
|
+
void ExitGame();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
#endregion
|
|
53
|
+
|
|
54
|
+
#region 视频广告
|
|
55
|
+
|
|
56
|
+
/*视频广告*/
|
|
57
|
+
public interface IVideoAD
|
|
58
|
+
{
|
|
59
|
+
void ShowVideo(string scene, Action success, Action<string> fail);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#endregion
|
|
63
|
+
|
|
64
|
+
#region 插页广告
|
|
65
|
+
|
|
66
|
+
/*插页广告*/
|
|
67
|
+
public interface IIntersAD
|
|
68
|
+
{
|
|
69
|
+
void ShowInters(string scene);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
#endregion
|
|
73
|
+
|
|
74
|
+
#region Banner条广告
|
|
75
|
+
|
|
76
|
+
/*banner广告*/
|
|
77
|
+
public interface IBannerAD
|
|
78
|
+
{
|
|
79
|
+
/*显示banner*/
|
|
80
|
+
void ShowBanner(string scene, BannerPosition position);
|
|
81
|
+
|
|
82
|
+
/*隐藏banner*/
|
|
83
|
+
void HideBanner(string scene);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#endregion
|
|
87
|
+
|
|
88
|
+
#region 原生广告
|
|
89
|
+
|
|
90
|
+
/*原生广告*/
|
|
91
|
+
public interface INativeAD
|
|
92
|
+
{
|
|
93
|
+
/*显示原生广告*/
|
|
94
|
+
void ShowNative(string scene);
|
|
95
|
+
|
|
96
|
+
/*隐藏原生广告*/
|
|
97
|
+
void HideNative(string scene);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#endregion
|
|
101
|
+
|
|
102
|
+
#region 悬浮ICON
|
|
103
|
+
|
|
104
|
+
/*悬浮ICON*/
|
|
105
|
+
public interface IFloatIconAD
|
|
106
|
+
{
|
|
107
|
+
/*显示悬浮icon广告*/
|
|
108
|
+
void ShowFloatIcon(string scene, float screenXP, float screenYP);
|
|
109
|
+
|
|
110
|
+
/*隐藏悬浮icon*/
|
|
111
|
+
void HideFloatIcon(string scene);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
#endregion
|
|
115
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
namespace TyphoonUnitySDK
|
|
4
|
+
{
|
|
5
|
+
public class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T>
|
|
6
|
+
{
|
|
7
|
+
private static T _instance = null;
|
|
8
|
+
private static object _lock = new object();
|
|
9
|
+
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// 创建实例
|
|
12
|
+
/// </summary>
|
|
13
|
+
/// <param name="target"></param>
|
|
14
|
+
public static void CreateInstance(GameObject target)
|
|
15
|
+
{
|
|
16
|
+
if (_instance != null)
|
|
17
|
+
{
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_instance = target.AddComponent<T>();
|
|
22
|
+
_instance.Init();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
/// 单例对象实例
|
|
27
|
+
/// </summary>
|
|
28
|
+
public static T Instance
|
|
29
|
+
{
|
|
30
|
+
get
|
|
31
|
+
{
|
|
32
|
+
if (_instance == null)
|
|
33
|
+
{
|
|
34
|
+
lock (_lock)
|
|
35
|
+
{
|
|
36
|
+
if (_instance == null)
|
|
37
|
+
{
|
|
38
|
+
GameObject clone = new GameObject(typeof(T).Name);
|
|
39
|
+
_instance = clone.AddComponent<T>();
|
|
40
|
+
_instance.Init();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return _instance;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// <summary>
|
|
50
|
+
/// 初始化,只会执行一次
|
|
51
|
+
/// </summary>
|
|
52
|
+
protected virtual void Init()
|
|
53
|
+
{
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
/// 构建实例
|
|
58
|
+
/// </summary>
|
|
59
|
+
public void Build()
|
|
60
|
+
{
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/// <summary>
|
|
64
|
+
/// 有示例
|
|
65
|
+
/// </summary>
|
|
66
|
+
public static bool HasInstance => _instance != null;
|
|
67
|
+
|
|
68
|
+
/// <summary>
|
|
69
|
+
/// 置空实例
|
|
70
|
+
/// </summary>
|
|
71
|
+
public static void SetInstanceNull()
|
|
72
|
+
{
|
|
73
|
+
_instance = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &3052855270983707171
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 2699745964915742218}
|
|
12
|
+
- component: {fileID: 2587331464460211208}
|
|
13
|
+
m_Layer: 0
|
|
14
|
+
m_Name: TYPHOON_SDK_TEST
|
|
15
|
+
m_TagString: Untagged
|
|
16
|
+
m_Icon: {fileID: 0}
|
|
17
|
+
m_NavMeshLayer: 0
|
|
18
|
+
m_StaticEditorFlags: 0
|
|
19
|
+
m_IsActive: 1
|
|
20
|
+
--- !u!4 &2699745964915742218
|
|
21
|
+
Transform:
|
|
22
|
+
m_ObjectHideFlags: 0
|
|
23
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
24
|
+
m_PrefabInstance: {fileID: 0}
|
|
25
|
+
m_PrefabAsset: {fileID: 0}
|
|
26
|
+
m_GameObject: {fileID: 3052855270983707171}
|
|
27
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
28
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
30
|
+
m_Children: []
|
|
31
|
+
m_Father: {fileID: 0}
|
|
32
|
+
m_RootOrder: 0
|
|
33
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
34
|
+
--- !u!114 &2587331464460211208
|
|
35
|
+
MonoBehaviour:
|
|
36
|
+
m_ObjectHideFlags: 0
|
|
37
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
38
|
+
m_PrefabInstance: {fileID: 0}
|
|
39
|
+
m_PrefabAsset: {fileID: 0}
|
|
40
|
+
m_GameObject: {fileID: 3052855270983707171}
|
|
41
|
+
m_Enabled: 1
|
|
42
|
+
m_EditorHideFlags: 0
|
|
43
|
+
m_Script: {fileID: 11500000, guid: c2fd32a072371b04b84c786471b7723a, type: 3}
|
|
44
|
+
m_Name:
|
|
45
|
+
m_EditorClassIdentifier:
|