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.
Files changed (207) hide show
  1. package/Editor/AddressableSupport.cs +269 -0
  2. package/Editor/AddressableSupport.cs.meta +11 -0
  3. package/Editor/ApplyTool.cs +315 -0
  4. package/Editor/ApplyTool.cs.meta +11 -0
  5. package/Editor/EditorIcons.cs +113 -0
  6. package/Editor/EditorIcons.cs.meta +11 -0
  7. package/Editor/ExportModule.cs +218 -0
  8. package/Editor/ExportModule.cs.meta +11 -0
  9. package/Editor/InstallModule.cs +38 -0
  10. package/Editor/InstallModule.cs.meta +11 -0
  11. package/Editor/Interactive/SDKInteractiveUI.prefab +3026 -0
  12. package/Editor/Interactive/SDKInteractiveUI.prefab.meta +7 -0
  13. package/Editor/Interactive/sdk_banner.png +0 -0
  14. package/Editor/Interactive/sdk_banner.png.meta +144 -0
  15. package/Editor/Interactive/sdk_close.png +0 -0
  16. package/Editor/Interactive/sdk_close.png.meta +120 -0
  17. package/Editor/Interactive/sdk_inters.png +0 -0
  18. package/Editor/Interactive/sdk_inters.png.meta +120 -0
  19. package/Editor/Interactive/sdk_white_4x4.png +0 -0
  20. package/Editor/Interactive/sdk_white_4x4.png.meta +120 -0
  21. package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png +0 -0
  22. package/Editor/Interactive/sdk_/345/244/261/350/264/245/350/277/224/345/233/236.png.meta +120 -0
  23. package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png +0 -0
  24. package/Editor/Interactive/sdk_/346/202/254/346/265/256/345/271/277/345/221/212.png.meta +120 -0
  25. package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png +0 -0
  26. package/Editor/Interactive/sdk_/346/210/220/345/212/237/350/277/224/345/233/236.png.meta +120 -0
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. package/Editor/Interactive.meta +8 -0
  34. package/Editor/OnApplyProcessor.cs +22 -0
  35. package/Editor/OnApplyProcessor.cs.meta +11 -0
  36. package/Editor/OnBuildAAProcessor.cs +12 -0
  37. package/Editor/OnBuildAAProcessor.cs.meta +11 -0
  38. package/Editor/OnPublicProcessor.cs +12 -0
  39. package/Editor/OnPublicProcessor.cs.meta +11 -0
  40. package/Editor/OriginalStyles.cs +708 -0
  41. package/Editor/OriginalStyles.cs.meta +11 -0
  42. package/Editor/Preferences.cs +43 -0
  43. package/Editor/Preferences.cs.meta +11 -0
  44. package/Editor/PreferencesWindow.cs +178 -0
  45. package/Editor/PreferencesWindow.cs.meta +11 -0
  46. package/Editor/PropertyInspectorEditor.cs +6 -0
  47. package/Editor/PropertyInspectorEditor.cs.meta +11 -0
  48. package/Editor/PublishProcess.cs +13 -0
  49. package/Editor/PublishProcess.cs.meta +11 -0
  50. package/Editor/PublishResult.cs +17 -0
  51. package/Editor/PublishResult.cs.meta +11 -0
  52. package/Editor/PublishSetting.cs +111 -0
  53. package/Editor/PublishSetting.cs.meta +11 -0
  54. package/Editor/PublishSettingGUIDrawer.cs +412 -0
  55. package/Editor/PublishSettingGUIDrawer.cs.meta +11 -0
  56. package/Editor/PublishSettingInspector.cs +29 -0
  57. package/Editor/PublishSettingInspector.cs.meta +11 -0
  58. package/Editor/PublishTool.cs +137 -0
  59. package/Editor/PublishTool.cs.meta +11 -0
  60. package/Editor/PublishVivoBatSetting.cs +62 -0
  61. package/Editor/PublishVivoBatSetting.cs.meta +11 -0
  62. package/Editor/PublishVivoBatSettingInspector.cs +371 -0
  63. package/Editor/PublishVivoBatSettingInspector.cs.meta +11 -0
  64. package/Editor/PublishVivoBatSettingWindow.cs +69 -0
  65. package/Editor/PublishVivoBatSettingWindow.cs.meta +11 -0
  66. package/Editor/PublishWindow.cs +364 -0
  67. package/Editor/PublishWindow.cs.meta +11 -0
  68. package/Editor/SdkFont.otf +0 -0
  69. package/Editor/SdkFont.otf.meta +21 -0
  70. package/Editor/SdkTestInUnityEditor.cs +20 -0
  71. package/Editor/SdkTestInUnityEditor.cs.meta +11 -0
  72. package/Editor/SdkTestInUnityWindow.cs +37 -0
  73. package/Editor/SdkTestInUnityWindow.cs.meta +11 -0
  74. package/Editor/Skin.guiskin +2673 -0
  75. package/Editor/Skin.guiskin.meta +8 -0
  76. package/Editor/Skins.cs +26 -0
  77. package/Editor/Skins.cs.meta +11 -0
  78. package/Editor/StyleEditorWindow.cs +23 -0
  79. package/Editor/StyleEditorWindow.cs.meta +11 -0
  80. package/Editor/Styles.cs +52 -0
  81. package/Editor/Styles.cs.meta +11 -0
  82. package/Editor/StylesExtension.cs +25 -0
  83. package/Editor/StylesExtension.cs.meta +11 -0
  84. package/Editor/Texture/btn_active.png +0 -0
  85. package/Editor/Texture/btn_active.png.meta +120 -0
  86. package/Editor/Texture/btn_blue_active.png +0 -0
  87. package/Editor/Texture/btn_blue_active.png.meta +120 -0
  88. package/Editor/Texture/btn_blue_hover.png +0 -0
  89. package/Editor/Texture/btn_blue_hover.png.meta +120 -0
  90. package/Editor/Texture/btn_blue_normal.png +0 -0
  91. package/Editor/Texture/btn_blue_normal.png.meta +120 -0
  92. package/Editor/Texture/btn_green_active.png +0 -0
  93. package/Editor/Texture/btn_green_active.png.meta +120 -0
  94. package/Editor/Texture/btn_green_hover.png +0 -0
  95. package/Editor/Texture/btn_green_hover.png.meta +120 -0
  96. package/Editor/Texture/btn_green_normal.png +0 -0
  97. package/Editor/Texture/btn_green_normal.png.meta +120 -0
  98. package/Editor/Texture/btn_hover.png +0 -0
  99. package/Editor/Texture/btn_hover.png.meta +120 -0
  100. package/Editor/Texture/btn_normal.png +0 -0
  101. package/Editor/Texture/btn_normal.png.meta +120 -0
  102. package/Editor/Texture/btn_yellow_active.png +0 -0
  103. package/Editor/Texture/btn_yellow_active.png.meta +120 -0
  104. package/Editor/Texture/btn_yellow_hover.png +0 -0
  105. package/Editor/Texture/btn_yellow_hover.png.meta +120 -0
  106. package/Editor/Texture/btn_yellow_normal.png +0 -0
  107. package/Editor/Texture/btn_yellow_normal.png.meta +120 -0
  108. package/Editor/Texture/icon_android.png +0 -0
  109. package/Editor/Texture/icon_android.png.meta +120 -0
  110. package/Editor/Texture/icon_douyin.png +0 -0
  111. package/Editor/Texture/icon_douyin.png.meta +120 -0
  112. package/Editor/Texture/icon_download.png +0 -0
  113. package/Editor/Texture/icon_download.png.meta +120 -0
  114. package/Editor/Texture/icon_error.png +0 -0
  115. package/Editor/Texture/icon_error.png.meta +144 -0
  116. package/Editor/Texture/icon_extension.png +0 -0
  117. package/Editor/Texture/icon_extension.png.meta +120 -0
  118. package/Editor/Texture/icon_googleplay.png +0 -0
  119. package/Editor/Texture/icon_googleplay.png.meta +120 -0
  120. package/Editor/Texture/icon_html5.png +0 -0
  121. package/Editor/Texture/icon_html5.png.meta +120 -0
  122. package/Editor/Texture/icon_import.png +0 -0
  123. package/Editor/Texture/icon_import.png.meta +144 -0
  124. package/Editor/Texture/icon_ios.png +0 -0
  125. package/Editor/Texture/icon_ios.png.meta +120 -0
  126. package/Editor/Texture/icon_oppo.png +0 -0
  127. package/Editor/Texture/icon_oppo.png.meta +120 -0
  128. package/Editor/Texture/icon_refresh.png +0 -0
  129. package/Editor/Texture/icon_refresh.png.meta +120 -0
  130. package/Editor/Texture/icon_save.png +0 -0
  131. package/Editor/Texture/icon_save.png.meta +120 -0
  132. package/Editor/Texture/icon_success.png +0 -0
  133. package/Editor/Texture/icon_success.png.meta +144 -0
  134. package/Editor/Texture/icon_vivo.png +0 -0
  135. package/Editor/Texture/icon_vivo.png.meta +120 -0
  136. package/Editor/Texture/icon_wechat.png +0 -0
  137. package/Editor/Texture/icon_wechat.png.meta +120 -0
  138. package/Editor/Texture/tex_select.png +0 -0
  139. package/Editor/Texture/tex_select.png.meta +120 -0
  140. package/Editor/Texture.meta +8 -0
  141. package/Editor/UniEditor.cs +451 -0
  142. package/Editor/UniEditor.cs.meta +11 -0
  143. package/Editor/com.typhoon.unitysdk.editor.asmdef +20 -0
  144. package/Editor/com.typhoon.unitysdk.editor.asmdef.meta +7 -0
  145. package/Editor.meta +8 -0
  146. package/Runtime/AndroidInstance.cs +125 -0
  147. package/Runtime/AndroidInstance.cs.meta +11 -0
  148. package/Runtime/AppChannel.cs +55 -0
  149. package/Runtime/AppChannel.cs.meta +11 -0
  150. package/Runtime/AppConfig.cs +28 -0
  151. package/Runtime/AppConfig.cs.meta +11 -0
  152. package/Runtime/AppConfigAsset.cs +50 -0
  153. package/Runtime/AppConfigAsset.cs.meta +11 -0
  154. package/Runtime/BannerPosition.cs +11 -0
  155. package/Runtime/BannerPosition.cs.meta +11 -0
  156. package/Runtime/BaseSdk.cs +78 -0
  157. package/Runtime/BaseSdk.cs.meta +11 -0
  158. package/Runtime/Extension.cs +58 -0
  159. package/Runtime/Extension.cs.meta +11 -0
  160. package/Runtime/Interface.cs +115 -0
  161. package/Runtime/Interface.cs.meta +11 -0
  162. package/Runtime/MonoSingleton.cs +76 -0
  163. package/Runtime/MonoSingleton.cs.meta +11 -0
  164. package/Runtime/Resources/TYPHOON_SDK_TEST.prefab +45 -0
  165. package/Runtime/Resources/TYPHOON_SDK_TEST.prefab.meta +7 -0
  166. package/Runtime/Resources.meta +8 -0
  167. package/Runtime/SDKInteractiveUI.cs +353 -0
  168. package/Runtime/SDKInteractiveUI.cs.meta +11 -0
  169. package/Runtime/SdkDebug.cs +23 -0
  170. package/Runtime/SdkDebug.cs.meta +11 -0
  171. package/Runtime/SdkTestInUnity.cs +45 -0
  172. package/Runtime/SdkTestInUnity.cs.meta +11 -0
  173. package/Runtime/SessionItem.cs +72 -0
  174. package/Runtime/SessionItem.cs.meta +11 -0
  175. package/Runtime/SimpleMap.cs +11 -0
  176. package/Runtime/SimpleMap.cs.meta +11 -0
  177. package/Runtime/TestSdk.cs +22 -0
  178. package/Runtime/TestSdk.cs.meta +11 -0
  179. package/Runtime/TyphoonSdk.cs +407 -0
  180. package/Runtime/TyphoonSdk.cs.meta +11 -0
  181. package/Runtime/TyphoonSdkCallback.cs +48 -0
  182. package/Runtime/TyphoonSdkCallback.cs.meta +11 -0
  183. package/Runtime/VersionType.cs +33 -0
  184. package/Runtime/VersionType.cs.meta +11 -0
  185. package/Runtime/com.typhoon.unitysdk.asmdef +3 -0
  186. package/Runtime/com.typhoon.unitysdk.asmdef.meta +7 -0
  187. package/Runtime.meta +8 -0
  188. package/Sources~/ChinaAndroid/Assets/Plugins/Android/AndroidManifest.xml +18 -0
  189. package/Sources~/ChinaAndroid/Assets/Plugins/Android/AndroidManifest.xml.meta +7 -0
  190. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/sdk_plug-release.aar +0 -0
  191. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/sdk_plug-release.aar.meta +32 -0
  192. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_app-release.aar +0 -0
  193. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_app-release.aar.meta +32 -0
  194. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_launcher-release.aar +0 -0
  195. package/Sources~/ChinaAndroid/Assets/Plugins/Android/libs/unity_launcher-release.aar.meta +32 -0
  196. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs +154 -0
  197. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/ChinaAndroidSdk.cs.meta +11 -0
  198. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs +56 -0
  199. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor/PublishChinaAndroidAAR.cs.meta +11 -0
  200. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Editor.meta +8 -0
  201. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources/TYPHOON_SDK_CHINA_ANDROID.prefab +45 -0
  202. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources/TYPHOON_SDK_CHINA_ANDROID.prefab.meta +7 -0
  203. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid/Resources.meta +8 -0
  204. package/Sources~/ChinaAndroid/Assets/Typhoon_Gen/TyphoonSDK/Runtime/ChinaAndroid.meta +8 -0
  205. package/Sources~/Package//345/270/270/347/224/250/346/211/223/345/214/205/351/205/215/347/275/256.unitypackage +0 -0
  206. package/package.json +1 -0
  207. 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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 47f782f7e0a15cd49af55bd34fb7be50
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 6b4f301c4c59eef42b87bcfd20966c6f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,11 @@
1
+ namespace TyphoonUnitySDK
2
+ {
3
+ /// <summary>
4
+ /// banner 条类型
5
+ /// </summary>
6
+ public enum BannerPosition
7
+ {
8
+ Bottom = 0,
9
+ Top = 1,
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 9f04e8da4096e104eb4e565f0ae8f174
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 800495eb7c5fd3142923709147cd944d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 8770ca67a8e262b49a5c61708bcf8c2e
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 240c858cf5dcb7242a410626cffbf175
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: d62f8181f4b1b4241b210a8d54faf590
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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:
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: db9ec57a2f7581c42a407ba8ac1e2439
3
+ PrefabImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 568ba7a08255db246a75e8f9df5417c3
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant: