com.taptap.sdk.core 4.3.0-aplha.12

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 (273) hide show
  1. package/Editor/BuildTargetUtils.cs +14 -0
  2. package/Editor/BuildTargetUtils.cs.meta +11 -0
  3. package/Editor/LinkXMLGenerator.cs +70 -0
  4. package/Editor/LinkXMLGenerator.cs.meta +11 -0
  5. package/Editor/Plist.cs +954 -0
  6. package/Editor/Plist.cs.meta +3 -0
  7. package/Editor/SDKLinkProcessBuild.cs +119 -0
  8. package/Editor/SDKLinkProcessBuild.cs.meta +11 -0
  9. package/Editor/TapFileHelper.cs +168 -0
  10. package/Editor/TapFileHelper.cs.meta +3 -0
  11. package/Editor/TapSDK.Core.Editor.asmdef +15 -0
  12. package/Editor/TapSDK.Core.Editor.asmdef.meta +7 -0
  13. package/Editor/TapSDKCoreCompile.cs +284 -0
  14. package/Editor/TapSDKCoreCompile.cs.meta +3 -0
  15. package/Editor/TapSDKCoreIOSProcessor.cs +74 -0
  16. package/Editor/TapSDKCoreIOSProcessor.cs.meta +3 -0
  17. package/Editor/UI/ScrollViewEditor.cs +267 -0
  18. package/Editor/UI/ScrollViewEditor.cs.meta +12 -0
  19. package/Editor/UI/ScrollViewExEditor.cs +34 -0
  20. package/Editor/UI/ScrollViewExEditor.cs.meta +12 -0
  21. package/Editor/UI/TapSDK.UI.Editor.asmdef +17 -0
  22. package/Editor/UI/TapSDK.UI.Editor.asmdef.meta +7 -0
  23. package/Editor/UI.meta +9 -0
  24. package/Editor.meta +8 -0
  25. package/Mobile/Editor/NativeDependencies.xml +22 -0
  26. package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
  27. package/Mobile/Editor/TapCommonMobileProcessBuild.cs +20 -0
  28. package/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta +11 -0
  29. package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef +17 -0
  30. package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef.meta +7 -0
  31. package/Mobile/Editor.meta +8 -0
  32. package/Mobile/Runtime/AndroidNativeWrapper.cs +50 -0
  33. package/Mobile/Runtime/AndroidNativeWrapper.cs.meta +11 -0
  34. package/Mobile/Runtime/Bridge.cs +84 -0
  35. package/Mobile/Runtime/Bridge.cs.meta +11 -0
  36. package/Mobile/Runtime/BridgeAndroid.cs +73 -0
  37. package/Mobile/Runtime/BridgeAndroid.cs.meta +11 -0
  38. package/Mobile/Runtime/BridgeCallback.cs +35 -0
  39. package/Mobile/Runtime/BridgeCallback.cs.meta +11 -0
  40. package/Mobile/Runtime/BridgeIOS.cs +113 -0
  41. package/Mobile/Runtime/BridgeIOS.cs.meta +11 -0
  42. package/Mobile/Runtime/Command.cs +119 -0
  43. package/Mobile/Runtime/Command.cs.meta +11 -0
  44. package/Mobile/Runtime/Constants.cs +9 -0
  45. package/Mobile/Runtime/Constants.cs.meta +11 -0
  46. package/Mobile/Runtime/EngineBridgeInitializer.cs +33 -0
  47. package/Mobile/Runtime/EngineBridgeInitializer.cs.meta +11 -0
  48. package/Mobile/Runtime/IBridge.cs +15 -0
  49. package/Mobile/Runtime/IBridge.cs.meta +11 -0
  50. package/Mobile/Runtime/IOSNativeWrapper.cs +273 -0
  51. package/Mobile/Runtime/IOSNativeWrapper.cs.meta +11 -0
  52. package/Mobile/Runtime/Result.cs +37 -0
  53. package/Mobile/Runtime/Result.cs.meta +11 -0
  54. package/Mobile/Runtime/TapCoreMobile.cs +71 -0
  55. package/Mobile/Runtime/TapCoreMobile.cs.meta +11 -0
  56. package/Mobile/Runtime/TapEventMobile.cs +265 -0
  57. package/Mobile/Runtime/TapEventMobile.cs.meta +11 -0
  58. package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef +18 -0
  59. package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef.meta +7 -0
  60. package/Mobile/Runtime/TapUUID.cs +9 -0
  61. package/Mobile/Runtime/TapUUID.cs.meta +11 -0
  62. package/Mobile/Runtime.meta +8 -0
  63. package/Mobile.meta +8 -0
  64. package/Plugins/iOS.meta +8 -0
  65. package/Plugins.meta +8 -0
  66. package/Resources/Fonts/taptap-sdk-bold.ttf +0 -0
  67. package/Resources/Fonts/taptap-sdk-bold.ttf.meta +22 -0
  68. package/Resources/Fonts/taptap-sdk.ttf +0 -0
  69. package/Resources/Fonts/taptap-sdk.ttf.meta +21 -0
  70. package/Resources/Fonts.meta +8 -0
  71. package/Resources/Loading.prefab +260 -0
  72. package/Resources/Loading.prefab.meta +7 -0
  73. package/Resources/TapCommonTip.prefab +194 -0
  74. package/Resources/TapCommonTip.prefab.meta +7 -0
  75. package/Resources/TapCommonToastBlack.prefab +528 -0
  76. package/Resources/TapCommonToastBlack.prefab.meta +7 -0
  77. package/Resources/TapCommonToastWhite.prefab +411 -0
  78. package/Resources/TapCommonToastWhite.prefab.meta +7 -0
  79. package/Resources/TapSDKCommonTapIcon-v2.png +0 -0
  80. package/Resources/TapSDKCommonTapIcon-v2.png.meta +128 -0
  81. package/Resources/TapSDKCommonTapIcon.png +0 -0
  82. package/Resources/TapSDKCommonTapIcon.png.meta +128 -0
  83. package/Resources/TapSDKCommonToastBg.png +0 -0
  84. package/Resources/TapSDKCommonToastBg.png.meta +128 -0
  85. package/Resources/TapSDKConstantUIRoot.prefab +100 -0
  86. package/Resources/TapSDKConstantUIRoot.prefab.meta +7 -0
  87. package/Resources/TapSDKUIRoot.prefab +100 -0
  88. package/Resources/TapSDKUIRoot.prefab.meta +7 -0
  89. package/Resources/TapTapBtn_White.png +0 -0
  90. package/Resources/TapTapBtn_White.png.meta +128 -0
  91. package/Resources/TapTapBtn_White_2.png +0 -0
  92. package/Resources/TapTapBtn_White_2.png.meta +128 -0
  93. package/Resources/ToastBackground.png +0 -0
  94. package/Resources/ToastBackground.png.meta +128 -0
  95. package/Resources/detail_bg.png +0 -0
  96. package/Resources/detail_bg.png.meta +92 -0
  97. package/Resources/success.png +0 -0
  98. package/Resources/success.png.meta +128 -0
  99. package/Resources/taptap-bg.png +0 -0
  100. package/Resources/taptap-bg.png.meta +140 -0
  101. package/Resources/taptap-close.png +0 -0
  102. package/Resources/taptap-close.png.meta +146 -0
  103. package/Resources/taptap-router-v2.png +0 -0
  104. package/Resources/taptap-router-v2.png.meta +128 -0
  105. package/Resources/taptap-router.png +0 -0
  106. package/Resources/taptap-router.png.meta +146 -0
  107. package/Resources/taptap-sdk-refresh 1.png +0 -0
  108. package/Resources/taptap-sdk-refresh 1.png.meta +128 -0
  109. package/Resources/taptap-toast-error.png +0 -0
  110. package/Resources/taptap-toast-error.png.meta +128 -0
  111. package/Resources/taptap-toast-info.png +0 -0
  112. package/Resources/taptap-toast-info.png.meta +128 -0
  113. package/Resources/taptap-toast-success.png +0 -0
  114. package/Resources/taptap-toast-success.png.meta +128 -0
  115. package/Resources/taptap-toast-warning.png +0 -0
  116. package/Resources/taptap-toast-warning.png.meta +128 -0
  117. package/Resources.meta +8 -0
  118. package/Runtime/Internal/Http/TapHttpClient.cs +176 -0
  119. package/Runtime/Internal/Http/TapHttpClient.cs.meta +11 -0
  120. package/Runtime/Internal/Http/TapHttpUtils.cs +83 -0
  121. package/Runtime/Internal/Http/TapHttpUtils.cs.meta +11 -0
  122. package/Runtime/Internal/Http.meta +8 -0
  123. package/Runtime/Internal/Init/IInitTask.cs +18 -0
  124. package/Runtime/Internal/Init/IInitTask.cs.meta +11 -0
  125. package/Runtime/Internal/Init.meta +8 -0
  126. package/Runtime/Internal/Json/TapJsonConverter.cs +40 -0
  127. package/Runtime/Internal/Json/TapJsonConverter.cs.meta +11 -0
  128. package/Runtime/Internal/Json.meta +8 -0
  129. package/Runtime/Internal/Platform/ITapCorePlatform.cs +12 -0
  130. package/Runtime/Internal/Platform/ITapCorePlatform.cs.meta +11 -0
  131. package/Runtime/Internal/Platform/ITapEventPlatform.cs +37 -0
  132. package/Runtime/Internal/Platform/ITapEventPlatform.cs.meta +11 -0
  133. package/Runtime/Internal/Platform/PlatformTypeUtils.cs +46 -0
  134. package/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta +11 -0
  135. package/Runtime/Internal/Platform.meta +8 -0
  136. package/Runtime/Internal/UI/Base/Const.cs +27 -0
  137. package/Runtime/Internal/UI/Base/Const.cs.meta +11 -0
  138. package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs +240 -0
  139. package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta +3 -0
  140. package/Runtime/Internal/UI/Base/LoadingPanelController.cs +29 -0
  141. package/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta +11 -0
  142. package/Runtime/Internal/UI/Base/MonoSingleton.cs +102 -0
  143. package/Runtime/Internal/UI/Base/MonoSingleton.cs.meta +11 -0
  144. package/Runtime/Internal/UI/Base/Singleton.cs +29 -0
  145. package/Runtime/Internal/UI/Base/Singleton.cs.meta +11 -0
  146. package/Runtime/Internal/UI/Base/TipPanelController.cs +45 -0
  147. package/Runtime/Internal/UI/Base/TipPanelController.cs.meta +3 -0
  148. package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs +95 -0
  149. package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta +11 -0
  150. package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs +79 -0
  151. package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta +3 -0
  152. package/Runtime/Internal/UI/Base/UIManager.cs +724 -0
  153. package/Runtime/Internal/UI/Base/UIManager.cs.meta +11 -0
  154. package/Runtime/Internal/UI/Base.meta +8 -0
  155. package/Runtime/Internal/UI/BasePanel/BasePanelController.cs +385 -0
  156. package/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta +11 -0
  157. package/Runtime/Internal/UI/BasePanel.meta +8 -0
  158. package/Runtime/Internal/UI/Params/BasePanelConfig.cs +18 -0
  159. package/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta +11 -0
  160. package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs +7 -0
  161. package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta +11 -0
  162. package/Runtime/Internal/UI/Params.meta +8 -0
  163. package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs +76 -0
  164. package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta +12 -0
  165. package/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta +9 -0
  166. package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs +828 -0
  167. package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta +12 -0
  168. package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs +245 -0
  169. package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta +12 -0
  170. package/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta +9 -0
  171. package/Runtime/Internal/UI/ScrollViewEx.meta +8 -0
  172. package/Runtime/Internal/UI.meta +8 -0
  173. package/Runtime/Internal/Utils/BridgeUtils.cs +29 -0
  174. package/Runtime/Internal/Utils/BridgeUtils.cs.meta +11 -0
  175. package/Runtime/Internal/Utils/ImageUtils.cs +147 -0
  176. package/Runtime/Internal/Utils/ImageUtils.cs.meta +11 -0
  177. package/Runtime/Internal/Utils/TapLoom.cs +155 -0
  178. package/Runtime/Internal/Utils/TapLoom.cs.meta +11 -0
  179. package/Runtime/Internal/Utils/UrlUtils.cs +34 -0
  180. package/Runtime/Internal/Utils/UrlUtils.cs.meta +11 -0
  181. package/Runtime/Internal/Utils.meta +8 -0
  182. package/Runtime/Internal.meta +8 -0
  183. package/Runtime/Public/DataStorage.cs +141 -0
  184. package/Runtime/Public/DataStorage.cs.meta +11 -0
  185. package/Runtime/Public/ITapPropertiesProxy.cs +6 -0
  186. package/Runtime/Public/ITapPropertiesProxy.cs.meta +11 -0
  187. package/Runtime/Public/Json.cs +636 -0
  188. package/Runtime/Public/Json.cs.meta +11 -0
  189. package/Runtime/Public/Log/TapLogLevel.cs +7 -0
  190. package/Runtime/Public/Log/TapLogLevel.cs.meta +11 -0
  191. package/Runtime/Public/Log/TapLogger.cs +48 -0
  192. package/Runtime/Public/Log/TapLogger.cs.meta +11 -0
  193. package/Runtime/Public/Log.meta +8 -0
  194. package/Runtime/Public/Platform.cs +27 -0
  195. package/Runtime/Public/Platform.cs.meta +11 -0
  196. package/Runtime/Public/RegionType.cs +8 -0
  197. package/Runtime/Public/RegionType.cs.meta +11 -0
  198. package/Runtime/Public/SafeDictionary.cs +27 -0
  199. package/Runtime/Public/SafeDictionary.cs.meta +11 -0
  200. package/Runtime/Public/TapError.cs +62 -0
  201. package/Runtime/Public/TapError.cs.meta +11 -0
  202. package/Runtime/Public/TapErrorCode.cs +44 -0
  203. package/Runtime/Public/TapErrorCode.cs.meta +11 -0
  204. package/Runtime/Public/TapException.cs +24 -0
  205. package/Runtime/Public/TapException.cs.meta +11 -0
  206. package/Runtime/Public/TapLanguage.cs +21 -0
  207. package/Runtime/Public/TapLanguage.cs.meta +11 -0
  208. package/Runtime/Public/TapLocalizeManager.cs +128 -0
  209. package/Runtime/Public/TapLocalizeManager.cs.meta +11 -0
  210. package/Runtime/Public/TapTapEvent.cs +93 -0
  211. package/Runtime/Public/TapTapEvent.cs.meta +11 -0
  212. package/Runtime/Public/TapTapSDK.cs +96 -0
  213. package/Runtime/Public/TapTapSDK.cs.meta +11 -0
  214. package/Runtime/Public/TapTapSDKCoreOptions.cs +104 -0
  215. package/Runtime/Public/TapTapSDKCoreOptions.cs.meta +11 -0
  216. package/Runtime/Public.meta +8 -0
  217. package/Runtime/TapSDK.Core.Runtime.asmdef +3 -0
  218. package/Runtime/TapSDK.Core.Runtime.asmdef.meta +7 -0
  219. package/Runtime.meta +8 -0
  220. package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs +20 -0
  221. package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs.meta +11 -0
  222. package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef +17 -0
  223. package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef.meta +7 -0
  224. package/Standalone/Editor.meta +8 -0
  225. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist +46 -0
  226. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist.meta +7 -0
  227. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo +0 -0
  228. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo.meta +7 -0
  229. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS.meta +8 -0
  230. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources +115 -0
  231. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
  232. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature.meta +8 -0
  233. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents.meta +8 -0
  234. package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle.meta +33 -0
  235. package/Standalone/Plugins/macOS.meta +8 -0
  236. package/Standalone/Plugins.meta +8 -0
  237. package/Standalone/Runtime/Internal/Constants.cs +37 -0
  238. package/Standalone/Runtime/Internal/Constants.cs.meta +11 -0
  239. package/Standalone/Runtime/Internal/DeviceInfo.cs +152 -0
  240. package/Standalone/Runtime/Internal/DeviceInfo.cs.meta +11 -0
  241. package/Standalone/Runtime/Internal/EventSender.cs +239 -0
  242. package/Standalone/Runtime/Internal/EventSender.cs.meta +11 -0
  243. package/Standalone/Runtime/Internal/Http/HttpClient.cs +211 -0
  244. package/Standalone/Runtime/Internal/Http/HttpClient.cs.meta +11 -0
  245. package/Standalone/Runtime/Internal/Http/NetUtils.cs +48 -0
  246. package/Standalone/Runtime/Internal/Http/NetUtils.cs.meta +11 -0
  247. package/Standalone/Runtime/Internal/Http/TimeUtil.cs +30 -0
  248. package/Standalone/Runtime/Internal/Http/TimeUtil.cs.meta +11 -0
  249. package/Standalone/Runtime/Internal/Http.meta +8 -0
  250. package/Standalone/Runtime/Internal/Identity.cs +43 -0
  251. package/Standalone/Runtime/Internal/Identity.cs.meta +11 -0
  252. package/Standalone/Runtime/Internal/PlayRecorder.cs +53 -0
  253. package/Standalone/Runtime/Internal/PlayRecorder.cs.meta +11 -0
  254. package/Standalone/Runtime/Internal/Prefs.cs +85 -0
  255. package/Standalone/Runtime/Internal/Prefs.cs.meta +11 -0
  256. package/Standalone/Runtime/Internal/Tracker.cs +318 -0
  257. package/Standalone/Runtime/Internal/Tracker.cs.meta +11 -0
  258. package/Standalone/Runtime/Internal/User.cs +51 -0
  259. package/Standalone/Runtime/Internal/User.cs.meta +11 -0
  260. package/Standalone/Runtime/Internal.meta +8 -0
  261. package/Standalone/Runtime/Public/EventManager.cs +41 -0
  262. package/Standalone/Runtime/Public/EventManager.cs.meta +11 -0
  263. package/Standalone/Runtime/Public/TapCoreStandalone.cs +197 -0
  264. package/Standalone/Runtime/Public/TapCoreStandalone.cs.meta +11 -0
  265. package/Standalone/Runtime/Public/TapEventStandalone.cs +281 -0
  266. package/Standalone/Runtime/Public/TapEventStandalone.cs.meta +11 -0
  267. package/Standalone/Runtime/Public.meta +8 -0
  268. package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +21 -0
  269. package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef.meta +7 -0
  270. package/Standalone/Runtime.meta +8 -0
  271. package/Standalone.meta +8 -0
  272. package/package.json +8 -0
  273. package/package.json.meta +7 -0
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: b61d97b2d6da94511a1e92afb1519d42
3
+ timeCreated: 1617120740
@@ -0,0 +1,267 @@
1
+ // -----------------------------------------------------------------------
2
+ // <copyright file="ScrollViewEditor.cs" company="AillieoTech">
3
+ // Copyright (c) AillieoTech. All rights reserved.
4
+ // </copyright>
5
+ // -----------------------------------------------------------------------
6
+
7
+ namespace TapSDK.UI.AillieoTech
8
+ {
9
+ using System;
10
+ using System.Linq;
11
+ using System.Reflection;
12
+ using UnityEditor;
13
+ using UnityEditor.UI;
14
+ using UnityEngine;
15
+ using UnityEngine.UI;
16
+
17
+ [CustomEditor(typeof(ScrollView))]
18
+ public class ScrollViewEditor : ScrollRectEditor
19
+ {
20
+ private const string bgPath = "UI/Skin/Background.psd";
21
+ private const string spritePath = "UI/Skin/UISprite.psd";
22
+ private const string maskPath = "UI/Skin/UIMask.psd";
23
+ private static Color panelColor = new Color(1f, 1f, 1f, 0.392f);
24
+ private static Color defaultSelectableColor = new Color(1f, 1f, 1f, 1f);
25
+ private static Vector2 thinElementSize = new Vector2(160f, 20f);
26
+ private static Action<GameObject, MenuCommand> PlaceUIElementRoot;
27
+
28
+ private SerializedProperty itemTemplate;
29
+ private SerializedProperty poolSize;
30
+ private SerializedProperty defaultItemSize;
31
+ private SerializedProperty layoutType;
32
+
33
+ private GUIStyle cachedCaption;
34
+
35
+ private GUIStyle caption
36
+ {
37
+ get
38
+ {
39
+ if (this.cachedCaption == null)
40
+ {
41
+ this.cachedCaption = new GUIStyle { richText = true, alignment = TextAnchor.MiddleCenter };
42
+ }
43
+
44
+ return this.cachedCaption;
45
+ }
46
+ }
47
+
48
+ public override void OnInspectorGUI()
49
+ {
50
+ this.serializedObject.Update();
51
+
52
+ EditorGUILayout.BeginVertical("box");
53
+ EditorGUILayout.LabelField("<b>Additional configs</b>", this.caption);
54
+ EditorGUILayout.Space();
55
+ this.DrawConfigInfo();
56
+ this.serializedObject.ApplyModifiedProperties();
57
+ EditorGUILayout.EndVertical();
58
+
59
+ EditorGUILayout.BeginVertical("box");
60
+ EditorGUILayout.LabelField("<b>For original ScrollRect</b>", this.caption);
61
+ EditorGUILayout.Space();
62
+ base.OnInspectorGUI();
63
+ EditorGUILayout.EndVertical();
64
+ }
65
+
66
+ protected static void InternalAddScrollView<T>(MenuCommand menuCommand)
67
+ where T : ScrollView
68
+ {
69
+ GetPrivateMethodByReflection();
70
+
71
+ GameObject root = CreateUIElementRoot(typeof(T).Name, new Vector2(200, 200));
72
+ PlaceUIElementRoot?.Invoke(root, menuCommand);
73
+
74
+ GameObject viewport = CreateUIObject("Viewport", root);
75
+ GameObject content = CreateUIObject("Content", viewport);
76
+
77
+ var parent = menuCommand.context as GameObject;
78
+ if (parent != null)
79
+ {
80
+ root.transform.SetParent(parent.transform, false);
81
+ }
82
+
83
+ Selection.activeGameObject = root;
84
+
85
+ GameObject hScrollbar = CreateScrollbar();
86
+ hScrollbar.name = "Scrollbar Horizontal";
87
+ hScrollbar.transform.SetParent(root.transform, false);
88
+ RectTransform hScrollbarRT = hScrollbar.GetComponent<RectTransform>();
89
+ hScrollbarRT.anchorMin = Vector2.zero;
90
+ hScrollbarRT.anchorMax = Vector2.right;
91
+ hScrollbarRT.pivot = Vector2.zero;
92
+ hScrollbarRT.sizeDelta = new Vector2(0, hScrollbarRT.sizeDelta.y);
93
+
94
+ GameObject vScrollbar = CreateScrollbar();
95
+ vScrollbar.name = "Scrollbar Vertical";
96
+ vScrollbar.transform.SetParent(root.transform, false);
97
+ vScrollbar.GetComponent<Scrollbar>().SetDirection(Scrollbar.Direction.BottomToTop, true);
98
+ RectTransform vScrollbarRT = vScrollbar.GetComponent<RectTransform>();
99
+ vScrollbarRT.anchorMin = Vector2.right;
100
+ vScrollbarRT.anchorMax = Vector2.one;
101
+ vScrollbarRT.pivot = Vector2.one;
102
+ vScrollbarRT.sizeDelta = new Vector2(vScrollbarRT.sizeDelta.x, 0);
103
+
104
+ RectTransform viewportRect = viewport.GetComponent<RectTransform>();
105
+ viewportRect.anchorMin = Vector2.zero;
106
+ viewportRect.anchorMax = Vector2.one;
107
+ viewportRect.sizeDelta = Vector2.zero;
108
+ viewportRect.pivot = Vector2.up;
109
+
110
+ RectTransform contentRect = content.GetComponent<RectTransform>();
111
+ contentRect.anchorMin = Vector2.up;
112
+ contentRect.anchorMax = Vector2.one;
113
+ contentRect.sizeDelta = new Vector2(0, 300);
114
+ contentRect.pivot = Vector2.up;
115
+
116
+ ScrollView scrollRect = root.AddComponent<T>();
117
+ scrollRect.content = contentRect;
118
+ scrollRect.viewport = viewportRect;
119
+ scrollRect.horizontalScrollbar = hScrollbar.GetComponent<Scrollbar>();
120
+ scrollRect.verticalScrollbar = vScrollbar.GetComponent<Scrollbar>();
121
+ scrollRect.horizontalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
122
+ scrollRect.verticalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport;
123
+ scrollRect.horizontalScrollbarSpacing = -3;
124
+ scrollRect.verticalScrollbarSpacing = -3;
125
+
126
+ Image rootImage = root.AddComponent<Image>();
127
+ rootImage.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>(bgPath);
128
+ rootImage.type = Image.Type.Sliced;
129
+ rootImage.color = panelColor;
130
+
131
+ Mask viewportMask = viewport.AddComponent<Mask>();
132
+ viewportMask.showMaskGraphic = false;
133
+
134
+ Image viewportImage = viewport.AddComponent<Image>();
135
+ viewportImage.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>(maskPath);
136
+ viewportImage.type = Image.Type.Sliced;
137
+ }
138
+
139
+ protected override void OnEnable()
140
+ {
141
+ base.OnEnable();
142
+
143
+ this.itemTemplate = this.serializedObject.FindProperty("itemTemplate");
144
+ this.poolSize = this.serializedObject.FindProperty("poolSize");
145
+ this.defaultItemSize = this.serializedObject.FindProperty("defaultItemSize");
146
+ this.layoutType = this.serializedObject.FindProperty("layoutType");
147
+ }
148
+
149
+ protected virtual void DrawConfigInfo()
150
+ {
151
+ EditorGUILayout.PropertyField(this.itemTemplate);
152
+ EditorGUILayout.PropertyField(this.poolSize);
153
+ EditorGUILayout.PropertyField(this.defaultItemSize);
154
+ this.layoutType.intValue = (int)(ScrollView.ItemLayoutType)EditorGUILayout.EnumPopup("layoutType", (ScrollView.ItemLayoutType)this.layoutType.intValue);
155
+ }
156
+
157
+ [MenuItem("GameObject/UI/DynamicScrollView", false, 90)]
158
+ private static void AddScrollView(MenuCommand menuCommand)
159
+ {
160
+ InternalAddScrollView<ScrollView>(menuCommand);
161
+ }
162
+
163
+ private static GameObject CreateScrollbar()
164
+ {
165
+ // Create GOs Hierarchy
166
+ GameObject scrollbarRoot = CreateUIElementRoot("Scrollbar", thinElementSize);
167
+ GameObject sliderArea = CreateUIObject("Sliding Area", scrollbarRoot);
168
+ GameObject handle = CreateUIObject("Handle", sliderArea);
169
+
170
+ Image bgImage = scrollbarRoot.AddComponent<Image>();
171
+ bgImage.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>(bgPath);
172
+ bgImage.type = Image.Type.Sliced;
173
+ bgImage.color = defaultSelectableColor;
174
+
175
+ Image handleImage = handle.AddComponent<Image>();
176
+ handleImage.sprite = AssetDatabase.GetBuiltinExtraResource<Sprite>(spritePath);
177
+ handleImage.type = Image.Type.Sliced;
178
+ handleImage.color = defaultSelectableColor;
179
+
180
+ RectTransform sliderAreaRect = sliderArea.GetComponent<RectTransform>();
181
+ sliderAreaRect.sizeDelta = new Vector2(-20, -20);
182
+ sliderAreaRect.anchorMin = Vector2.zero;
183
+ sliderAreaRect.anchorMax = Vector2.one;
184
+
185
+ RectTransform handleRect = handle.GetComponent<RectTransform>();
186
+ handleRect.sizeDelta = new Vector2(20, 20);
187
+
188
+ Scrollbar scrollbar = scrollbarRoot.AddComponent<Scrollbar>();
189
+ scrollbar.handleRect = handleRect;
190
+ scrollbar.targetGraphic = handleImage;
191
+ SetDefaultColorTransitionValues(scrollbar);
192
+
193
+ return scrollbarRoot;
194
+ }
195
+
196
+ private static GameObject CreateUIElementRoot(string name, Vector2 size)
197
+ {
198
+ var child = new GameObject(name);
199
+ RectTransform rectTransform = child.AddComponent<RectTransform>();
200
+ rectTransform.sizeDelta = size;
201
+ return child;
202
+ }
203
+
204
+ private static GameObject CreateUIObject(string name, GameObject parent)
205
+ {
206
+ var go = new GameObject(name);
207
+ go.AddComponent<RectTransform>();
208
+ SetParentAndAlign(go, parent);
209
+ return go;
210
+ }
211
+
212
+ private static void SetParentAndAlign(GameObject child, GameObject parent)
213
+ {
214
+ if (parent == null)
215
+ {
216
+ return;
217
+ }
218
+
219
+ child.transform.SetParent(parent.transform, false);
220
+ SetLayerRecursively(child, parent.layer);
221
+ }
222
+
223
+ private static void SetLayerRecursively(GameObject go, int layer)
224
+ {
225
+ go.layer = layer;
226
+ Transform t = go.transform;
227
+ for (var i = 0; i < t.childCount; i++)
228
+ {
229
+ SetLayerRecursively(t.GetChild(i).gameObject, layer);
230
+ }
231
+ }
232
+
233
+ private static void SetDefaultColorTransitionValues(Selectable slider)
234
+ {
235
+ ColorBlock colors = slider.colors;
236
+ colors.highlightedColor = new Color(0.882f, 0.882f, 0.882f);
237
+ colors.pressedColor = new Color(0.698f, 0.698f, 0.698f);
238
+ colors.disabledColor = new Color(0.521f, 0.521f, 0.521f);
239
+ }
240
+
241
+ private static void GetPrivateMethodByReflection()
242
+ {
243
+ if (PlaceUIElementRoot == null)
244
+ {
245
+ Assembly uiEditorAssembly = AppDomain.CurrentDomain.GetAssemblies()
246
+ .FirstOrDefault(asm => asm.GetName().Name == "UnityEditor.UI");
247
+ if (uiEditorAssembly != null)
248
+ {
249
+ Type menuOptionType = uiEditorAssembly.GetType("UnityEditor.UI.MenuOptions");
250
+ if (menuOptionType != null)
251
+ {
252
+ MethodInfo miPlaceUIElementRoot = menuOptionType.GetMethod(
253
+ "PlaceUIElementRoot",
254
+ BindingFlags.NonPublic | BindingFlags.Static);
255
+ if (miPlaceUIElementRoot != null)
256
+ {
257
+ PlaceUIElementRoot = Delegate.CreateDelegate(
258
+ typeof(Action<GameObject, MenuCommand>),
259
+ miPlaceUIElementRoot)
260
+ as Action<GameObject, MenuCommand>;
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
@@ -0,0 +1,12 @@
1
+ fileFormatVersion: 2
2
+ guid: c20879c71b49a4b32b4170efe40af02c
3
+ timeCreated: 1533042733
4
+ licenseType: Free
5
+ MonoImporter:
6
+ serializedVersion: 2
7
+ defaultReferences: []
8
+ executionOrder: 0
9
+ icon: {instanceID: 0}
10
+ userData:
11
+ assetBundleName:
12
+ assetBundleVariant:
@@ -0,0 +1,34 @@
1
+ // -----------------------------------------------------------------------
2
+ // <copyright file="ScrollViewExEditor.cs" company="AillieoTech">
3
+ // Copyright (c) AillieoTech. All rights reserved.
4
+ // </copyright>
5
+ // -----------------------------------------------------------------------
6
+
7
+ namespace TapSDK.UI.AillieoTech
8
+ {
9
+ using UnityEditor;
10
+
11
+ [CustomEditor(typeof(ScrollViewEx))]
12
+ public class ScrollViewExEditor : ScrollViewEditor
13
+ {
14
+ private SerializedProperty pageSize;
15
+
16
+ protected override void OnEnable()
17
+ {
18
+ base.OnEnable();
19
+ this.pageSize = this.serializedObject.FindProperty("pageSize");
20
+ }
21
+
22
+ protected override void DrawConfigInfo()
23
+ {
24
+ base.DrawConfigInfo();
25
+ EditorGUILayout.PropertyField(this.pageSize);
26
+ }
27
+
28
+ [MenuItem("GameObject/UI/DynamicScrollViewEx", false, 90)]
29
+ private static void AddScrollViewEx(MenuCommand menuCommand)
30
+ {
31
+ InternalAddScrollView<ScrollViewEx>(menuCommand);
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,12 @@
1
+ fileFormatVersion: 2
2
+ guid: 0d7c4e920d9c4441a83c3d500596fb75
3
+ timeCreated: 1533042733
4
+ licenseType: Free
5
+ MonoImporter:
6
+ serializedVersion: 2
7
+ defaultReferences: []
8
+ executionOrder: 0
9
+ icon: {instanceID: 0}
10
+ userData:
11
+ assetBundleName:
12
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "TapSDK.UI.Editor",
3
+ "references": [
4
+ "GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7"
5
+ ],
6
+ "includePlatforms": [
7
+ "Editor"
8
+ ],
9
+ "excludePlatforms": [],
10
+ "allowUnsafeCode": false,
11
+ "overrideReferences": false,
12
+ "precompiledReferences": [],
13
+ "autoReferenced": true,
14
+ "defineConstraints": [],
15
+ "versionDefines": [],
16
+ "noEngineReferences": false
17
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: d9925423e828d479c9063ea882f31e06
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Editor/UI.meta ADDED
@@ -0,0 +1,9 @@
1
+ fileFormatVersion: 2
2
+ guid: 6301720de19974c94b52839ed842dc3f
3
+ folderAsset: yes
4
+ timeCreated: 1533042733
5
+ licenseType: Free
6
+ DefaultImporter:
7
+ userData:
8
+ assetBundleName:
9
+ assetBundleVariant:
package/Editor.meta ADDED
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 829b7cb0b66da498b9d1cc859956fc7c
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,22 @@
1
+ <dependencies>
2
+
3
+ <!-- Android maven dependencies -->
4
+ <androidPackages>
5
+ <repositories>
6
+ <repository>https://repo.maven.apache.org/maven2</repository>
7
+ </repositories>
8
+ <androidPackage spec="com.taptap.sdk:tap-core-unity:4.3.0"/>
9
+ </androidPackages>
10
+
11
+ <!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
12
+ <iosPods>
13
+ <sources>
14
+ <source>https://github.com/CocoaPods/Specs.git</source>
15
+ </sources>
16
+
17
+ <iosPod name="Protobuf" version="~> 3.0" bitcodeEnabled="false" addToAllTargets="false"/>
18
+ <iosPod name="TapTapCoreSDK" version="~> 4.3.0" bitcodeEnabled="false" addToAllTargets="false"/>
19
+
20
+ </iosPods>
21
+
22
+ </dependencies>
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: b969d6e811d804faca9742abe7c51db0
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,20 @@
1
+ using System;
2
+ using UnityEditor.Build.Reporting;
3
+ using TapSDK.Core.Editor;
4
+
5
+ namespace TapSDK.Core.Mobile.Editor {
6
+ public class TapCommonMobileProcessBuild : SDKLinkProcessBuild {
7
+ public override int callbackOrder => 0;
8
+
9
+ public override string LinkPath => "TapSDK/Core/link.xml";
10
+
11
+ public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
12
+ new LinkedAssembly { Fullname = "TapSDK.Core.Runtime" },
13
+ new LinkedAssembly { Fullname = "TapSDK.Core.Mobile.Runtime" }
14
+ };
15
+
16
+ public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
17
+ return BuildTargetUtils.IsSupportMobile(report.summary.platform);
18
+ };
19
+ }
20
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: e8e298a37fded43bb96e28c921c396d5
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,17 @@
1
+ {
2
+ "name": "TapSDK.Core.Mobile.Editor",
3
+ "references": [
4
+ "GUID:56f3da7a178484843974054bafe77e73"
5
+ ],
6
+ "includePlatforms": [
7
+ "Editor"
8
+ ],
9
+ "excludePlatforms": [],
10
+ "allowUnsafeCode": false,
11
+ "overrideReferences": false,
12
+ "precompiledReferences": [],
13
+ "autoReferenced": true,
14
+ "defineConstraints": [],
15
+ "versionDefines": [],
16
+ "noEngineReferences": false
17
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 4f379049292174fb88b6a19b4c7fc83b
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 17753ed93cd314b168087b8f75b02b00
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,50 @@
1
+ using System;
2
+ using System.Runtime.InteropServices;
3
+ using UnityEngine;
4
+ using System.Collections;
5
+ using TapSDK.Core;
6
+ using TapSDK.Core.Internal;
7
+ using System.Collections.Generic;
8
+
9
+ namespace TapSDK.Core.Mobile{
10
+ internal class AndroidNativeWrapper
11
+ {
12
+ private static AndroidJavaClass tapTapEventClass;
13
+
14
+ public static void RegisterDynamicProperties(Func<string> callback)
15
+ {
16
+ tapTapEventClass = new AndroidJavaClass("com.taptap.sdk.core.TapTapEvent");
17
+ AndroidJavaProxy dynamicPropertiesProxy = new TapEventDynamicPropertiesProxy(callback);
18
+ tapTapEventClass.CallStatic("registerDynamicProperties", dynamicPropertiesProxy);
19
+ }
20
+
21
+ private class TapEventDynamicPropertiesProxy : AndroidJavaProxy
22
+ {
23
+ private Func<string> callback;
24
+
25
+ public TapEventDynamicPropertiesProxy(Func<string> callback)
26
+ : base("com.taptap.sdk.core.TapTapEvent$TapEventDynamicProperties")
27
+ {
28
+ this.callback = callback;
29
+ }
30
+
31
+ public AndroidJavaObject getDynamicProperties()
32
+ {
33
+ try
34
+ {
35
+ string json = callback();
36
+ if (!string.IsNullOrEmpty(json))
37
+ {
38
+ return new AndroidJavaObject("org.json.JSONObject", json);
39
+ }
40
+ }
41
+ catch (Exception e)
42
+ {
43
+ Debug.LogError("Failed to get dynamic properties: " + e.Message);
44
+ }
45
+ return null;
46
+ }
47
+ }
48
+
49
+ }
50
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: da60c9deeb9b14586a7e4a0eec603fbb
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,84 @@
1
+ using System;
2
+ using System.Threading.Tasks;
3
+
4
+ namespace TapSDK.Core
5
+ {
6
+ public class EngineBridge
7
+ {
8
+ private static volatile EngineBridge _sInstance;
9
+
10
+ private readonly IBridge _bridge;
11
+
12
+ private static readonly object Locker = new object();
13
+
14
+ public static EngineBridge GetInstance()
15
+ {
16
+ lock (Locker)
17
+ {
18
+ if (_sInstance == null)
19
+ {
20
+ _sInstance = new EngineBridge();
21
+ }
22
+ }
23
+
24
+ return _sInstance;
25
+ }
26
+
27
+ private EngineBridge()
28
+ {
29
+ if (Platform.IsAndroid())
30
+ {
31
+ _bridge = BridgeAndroid.GetInstance();
32
+ }
33
+ else if (Platform.IsIOS())
34
+ {
35
+ _bridge = BridgeIOS.GetInstance();
36
+ }
37
+ }
38
+
39
+ public void Register(string serviceClzName, string serviceImplName)
40
+ {
41
+ _bridge?.Register(serviceClzName, serviceImplName);
42
+ }
43
+
44
+ public void CallHandler(Command command)
45
+ {
46
+ _bridge?.Call(command);
47
+ }
48
+
49
+ public string CallWithReturnValue(Command command, Action<Result> action = null)
50
+ {
51
+ return _bridge?.CallWithReturnValue(command, action);
52
+ }
53
+
54
+ public void CallHandler(Command command, Action<Result> action)
55
+ {
56
+ _bridge?.Call(command, action);
57
+ }
58
+
59
+ public Task<Result> Emit(Command command)
60
+ {
61
+ var tcs = new TaskCompletionSource<Result>();
62
+ CallHandler(command, result =>
63
+ {
64
+ tcs.TrySetResult(result);
65
+ });
66
+ return tcs.Task;
67
+ }
68
+
69
+ public static bool CheckResult(Result result)
70
+ {
71
+ if (result == null)
72
+ {
73
+ return false;
74
+ }
75
+
76
+ if (result.code != Result.RESULT_SUCCESS)
77
+ {
78
+ return false;
79
+ }
80
+
81
+ return !string.IsNullOrEmpty(result.content);
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 168155d160dc0448bb9f57e609c284af
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: