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,636 @@
1
+ /*
2
+ * Copyright (c) 2013 Calvin Rien
3
+ *
4
+ * Based on the JSON parser by Patrick van Bergen
5
+ * http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
6
+ *
7
+ * Simplified it so that it doesn't throw exceptions
8
+ * and can be used in Unity iPhone with maximum code stripping.
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining
11
+ * a copy of this software and associated documentation files (the
12
+ * "Software"), to deal in the Software without restriction, including
13
+ * without limitation the rights to use, copy, modify, merge, publish,
14
+ * distribute, sublicense, and/or sell copies of the Software, and to
15
+ * permit persons to whom the Software is furnished to do so, subject to
16
+ * the following conditions:
17
+ *
18
+ * The above copyright notice and this permission notice shall be
19
+ * included in all copies or substantial portions of the Software.
20
+ *
21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ */
29
+ using System;
30
+ using System.Collections;
31
+ using System.Collections.Generic;
32
+ using System.IO;
33
+ using System.Text;
34
+ using System.Globalization;
35
+
36
+ //Serializer,Serialize
37
+
38
+ namespace TapSDK.Core
39
+ {
40
+ // Example usage:
41
+ //
42
+ // using UnityEngine;
43
+ // using System.Collections;
44
+ // using System.Collections.Generic;
45
+ // using MiniJSON;
46
+ //
47
+ // public class MiniJSONTest : MonoBehaviour {
48
+ // void Start () {
49
+ // var jsonString = "{ \"array\": [1.44,2,3], " +
50
+ // "\"object\": {\"key1\":\"value1\", \"key2\":256}, " +
51
+ // "\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " +
52
+ // "\"unicode\": \"\\u3041 Men\u00fa sesi\u00f3n\", " +
53
+ // "\"int\": 65536, " +
54
+ // "\"float\": 3.1415926, " +
55
+ // "\"bool\": true, " +
56
+ // "\"null\": null }";
57
+ //
58
+ // var dict = Json.Deserialize(jsonString) as Dictionary<string,object>;
59
+ //
60
+ // Debug.Log("deserialized: " + dict.GetType());
61
+ // Debug.Log("dict['array'][0]: " + ((List<object>) dict["array"])[0]);
62
+ // Debug.Log("dict['string']: " + (string) dict["string"]);
63
+ // Debug.Log("dict['float']: " + (double) dict["float"]); // floats come out as doubles
64
+ // Debug.Log("dict['int']: " + (long) dict["int"]); // ints come out as longs
65
+ // Debug.Log("dict['unicode']: " + (string) dict["unicode"]);
66
+ //
67
+ // var str = Json.Serialize(dict);
68
+ //
69
+ // Debug.Log("serialized: " + str);
70
+ // }
71
+ // }
72
+
73
+ /// <summary>
74
+ /// This class encodes and decodes JSON strings.
75
+ /// Spec. details, see http://www.json.org/
76
+ ///
77
+ /// JSON uses Arrays and Objects. These correspond here to the datatypes IList and IDictionary.
78
+ /// All numbers are parsed to doubles.
79
+ /// </summary>
80
+ public static class Json
81
+ {
82
+
83
+ /// <summary>
84
+ /// Parses the string json into a value
85
+ /// </summary>
86
+ /// <param name="json">A JSON string.</param>
87
+ /// <returns>An List&lt;object&gt;, a Dictionary&lt;string, object&gt;, a double, an integer,a string, null, true, or false</returns>
88
+ public static object Deserialize(string json)
89
+ {
90
+ // save the string for debug information
91
+ if (json == null)
92
+ {
93
+ return null;
94
+ }
95
+
96
+ return Parser.Parse(json);
97
+ }
98
+
99
+ sealed class Parser : IDisposable
100
+ {
101
+ const string WORD_BREAK = "{}[],:\"";
102
+
103
+ public static bool IsWordBreak(char c)
104
+ {
105
+ return Char.IsWhiteSpace(c) || WORD_BREAK.IndexOf(c) != -1;
106
+ }
107
+
108
+ enum TOKEN
109
+ {
110
+ NONE,
111
+ CURLY_OPEN,
112
+ CURLY_CLOSE,
113
+ SQUARED_OPEN,
114
+ SQUARED_CLOSE,
115
+ COLON,
116
+ COMMA,
117
+ STRING,
118
+ NUMBER,
119
+ TRUE,
120
+ FALSE,
121
+ NULL
122
+ };
123
+
124
+ StringReader json;
125
+
126
+ Parser(string jsonString)
127
+ {
128
+ json = new StringReader(jsonString);
129
+ }
130
+
131
+ public static object Parse(string jsonString)
132
+ {
133
+ using (var instance = new Parser(jsonString))
134
+ {
135
+ return instance.ParseValue();
136
+ }
137
+ }
138
+
139
+ public void Dispose()
140
+ {
141
+ json.Dispose();
142
+ json = null;
143
+ }
144
+
145
+ Dictionary<string, object> ParseObject()
146
+ {
147
+ Dictionary<string, object> table = new Dictionary<string, object>();
148
+
149
+ // ditch opening brace
150
+ json.Read();
151
+
152
+ // {
153
+ while (true)
154
+ {
155
+ switch (NextToken)
156
+ {
157
+ case TOKEN.NONE:
158
+ return null;
159
+ case TOKEN.COMMA:
160
+ continue;
161
+ case TOKEN.CURLY_CLOSE:
162
+ return table;
163
+ default:
164
+ // name
165
+ string name = ParseString();
166
+ if (name == null)
167
+ {
168
+ return null;
169
+ }
170
+
171
+ // :
172
+ if (NextToken != TOKEN.COLON)
173
+ {
174
+ return null;
175
+ }
176
+ // ditch the colon
177
+ json.Read();
178
+
179
+ // value
180
+ table[name] = ParseValue();
181
+ break;
182
+ }
183
+ }
184
+ }
185
+
186
+ List<object> ParseArray()
187
+ {
188
+ List<object> array = new List<object>();
189
+
190
+ // ditch opening bracket
191
+ json.Read();
192
+
193
+ // [
194
+ var parsing = true;
195
+ while (parsing)
196
+ {
197
+ TOKEN nextToken = NextToken;
198
+
199
+ switch (nextToken)
200
+ {
201
+ case TOKEN.NONE:
202
+ return null;
203
+ case TOKEN.COMMA:
204
+ continue;
205
+ case TOKEN.SQUARED_CLOSE:
206
+ parsing = false;
207
+ break;
208
+ default:
209
+ object value = ParseByToken(nextToken);
210
+
211
+ array.Add(value);
212
+ break;
213
+ }
214
+ }
215
+
216
+ return array;
217
+ }
218
+
219
+ object ParseValue()
220
+ {
221
+ TOKEN nextToken = NextToken;
222
+ return ParseByToken(nextToken);
223
+ }
224
+
225
+ object ParseByToken(TOKEN token)
226
+ {
227
+ switch (token)
228
+ {
229
+ case TOKEN.STRING:
230
+ return ParseString();
231
+ case TOKEN.NUMBER:
232
+ return ParseNumber();
233
+ case TOKEN.CURLY_OPEN:
234
+ return ParseObject();
235
+ case TOKEN.SQUARED_OPEN:
236
+ return ParseArray();
237
+ case TOKEN.TRUE:
238
+ return true;
239
+ case TOKEN.FALSE:
240
+ return false;
241
+ case TOKEN.NULL:
242
+ return null;
243
+ default:
244
+ return null;
245
+ }
246
+ }
247
+
248
+ string ParseString()
249
+ {
250
+ StringBuilder s = new StringBuilder();
251
+ char c;
252
+
253
+ // ditch opening quote
254
+ json.Read();
255
+
256
+ bool parsing = true;
257
+ while (parsing)
258
+ {
259
+
260
+ if (json.Peek() == -1)
261
+ {
262
+ parsing = false;
263
+ break;
264
+ }
265
+
266
+ c = NextChar;
267
+ switch (c)
268
+ {
269
+ case '"':
270
+ parsing = false;
271
+ break;
272
+ case '\\':
273
+ if (json.Peek() == -1)
274
+ {
275
+ parsing = false;
276
+ break;
277
+ }
278
+
279
+ c = NextChar;
280
+ switch (c)
281
+ {
282
+ case '"':
283
+ case '\\':
284
+ case '/':
285
+ s.Append(c);
286
+ break;
287
+ case 'b':
288
+ s.Append('\b');
289
+ break;
290
+ case 'f':
291
+ s.Append('\f');
292
+ break;
293
+ case 'n':
294
+ s.Append('\n');
295
+ break;
296
+ case 'r':
297
+ s.Append('\r');
298
+ break;
299
+ case 't':
300
+ s.Append('\t');
301
+ break;
302
+ case 'u':
303
+ var hex = new char[4];
304
+
305
+ for (int i = 0; i < 4; i++)
306
+ {
307
+ hex[i] = NextChar;
308
+ }
309
+
310
+ s.Append((char)Convert.ToInt32(new string(hex), 16));
311
+ break;
312
+ }
313
+ break;
314
+ default:
315
+ s.Append(c);
316
+ break;
317
+ }
318
+ }
319
+
320
+ return s.ToString();
321
+ }
322
+
323
+ object ParseNumber()
324
+ {
325
+ string number = NextWord;
326
+
327
+ if (number.IndexOf('.') == -1)
328
+ {
329
+ long parsedInt;
330
+ Int64.TryParse(number, NumberStyles.Number, CultureInfo.InvariantCulture, out parsedInt);
331
+ return parsedInt;
332
+ }
333
+
334
+ double parsedDouble;
335
+ Double.TryParse(number, NumberStyles.Number, CultureInfo.InvariantCulture, out parsedDouble);
336
+ return parsedDouble;
337
+ }
338
+
339
+ void EatWhitespace()
340
+ {
341
+ while (Char.IsWhiteSpace(PeekChar))
342
+ {
343
+ json.Read();
344
+
345
+ if (json.Peek() == -1)
346
+ {
347
+ break;
348
+ }
349
+ }
350
+ }
351
+
352
+ char PeekChar
353
+ {
354
+ get
355
+ {
356
+ return Convert.ToChar(json.Peek());
357
+ }
358
+ }
359
+
360
+ char NextChar
361
+ {
362
+ get
363
+ {
364
+ return Convert.ToChar(json.Read());
365
+ }
366
+ }
367
+
368
+ string NextWord
369
+ {
370
+ get
371
+ {
372
+ StringBuilder word = new StringBuilder();
373
+
374
+ while (!IsWordBreak(PeekChar))
375
+ {
376
+ word.Append(NextChar);
377
+
378
+ if (json.Peek() == -1)
379
+ {
380
+ break;
381
+ }
382
+ }
383
+
384
+ return word.ToString();
385
+ }
386
+ }
387
+
388
+ TOKEN NextToken
389
+ {
390
+ get
391
+ {
392
+ EatWhitespace();
393
+
394
+ if (json.Peek() == -1)
395
+ {
396
+ return TOKEN.NONE;
397
+ }
398
+
399
+ switch (PeekChar)
400
+ {
401
+ case '{':
402
+ return TOKEN.CURLY_OPEN;
403
+ case '}':
404
+ json.Read();
405
+ return TOKEN.CURLY_CLOSE;
406
+ case '[':
407
+ return TOKEN.SQUARED_OPEN;
408
+ case ']':
409
+ json.Read();
410
+ return TOKEN.SQUARED_CLOSE;
411
+ case ',':
412
+ json.Read();
413
+ return TOKEN.COMMA;
414
+ case '"':
415
+ return TOKEN.STRING;
416
+ case ':':
417
+ return TOKEN.COLON;
418
+ case '0':
419
+ case '1':
420
+ case '2':
421
+ case '3':
422
+ case '4':
423
+ case '5':
424
+ case '6':
425
+ case '7':
426
+ case '8':
427
+ case '9':
428
+ case '-':
429
+ return TOKEN.NUMBER;
430
+ }
431
+
432
+ switch (NextWord)
433
+ {
434
+ case "false":
435
+ return TOKEN.FALSE;
436
+ case "true":
437
+ return TOKEN.TRUE;
438
+ case "null":
439
+ return TOKEN.NULL;
440
+ }
441
+
442
+ return TOKEN.NONE;
443
+ }
444
+ }
445
+ }
446
+
447
+ /// <summary>
448
+ /// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
449
+ /// </summary>
450
+ /// <param name="json">A Dictionary&lt;string, object&gt; / List&lt;object&gt;</param>
451
+ /// <returns>A JSON encoded string, or null if object 'json' is not serializable</returns>
452
+ public static string Serialize(object obj)
453
+ {
454
+ return Serializer.Serialize(obj);
455
+ }
456
+
457
+ sealed class Serializer
458
+ {
459
+ StringBuilder builder;
460
+
461
+ Serializer()
462
+ {
463
+ builder = new StringBuilder();
464
+ }
465
+
466
+ public static string Serialize(object obj)
467
+ {
468
+ var instance = new Serializer();
469
+
470
+ instance.SerializeValue(obj);
471
+
472
+ return instance.builder.ToString();
473
+ }
474
+
475
+ void SerializeValue(object value)
476
+ {
477
+ IList asList;
478
+ IDictionary asDict;
479
+ string asStr;
480
+
481
+ if (value == null)
482
+ {
483
+ builder.Append("null");
484
+ }
485
+ else if ((asStr = value as string) != null)
486
+ {
487
+ SerializeString(asStr);
488
+ }
489
+ else if (value is bool)
490
+ {
491
+ builder.Append((bool)value ? "true" : "false");
492
+ }
493
+ else if ((asList = value as IList) != null)
494
+ {
495
+ SerializeArray(asList);
496
+ }
497
+ else if ((asDict = value as IDictionary) != null)
498
+ {
499
+ SerializeObject(asDict);
500
+ }
501
+ else if (value is char)
502
+ {
503
+ SerializeString(new string((char)value, 1));
504
+ }
505
+ else
506
+ {
507
+ SerializeOther(value);
508
+ }
509
+ }
510
+
511
+ void SerializeObject(IDictionary obj)
512
+ {
513
+ bool first = true;
514
+
515
+ builder.Append('{');
516
+
517
+ foreach (object e in obj.Keys)
518
+ {
519
+ if (!first)
520
+ {
521
+ builder.Append(',');
522
+ }
523
+
524
+ SerializeString(e.ToString());
525
+ builder.Append(':');
526
+
527
+ SerializeValue(obj[e]);
528
+
529
+ first = false;
530
+ }
531
+
532
+ builder.Append('}');
533
+ }
534
+
535
+ void SerializeArray(IList anArray)
536
+ {
537
+ builder.Append('[');
538
+
539
+ bool first = true;
540
+
541
+ foreach (object obj in anArray)
542
+ {
543
+ if (!first)
544
+ {
545
+ builder.Append(',');
546
+ }
547
+
548
+ SerializeValue(obj);
549
+
550
+ first = false;
551
+ }
552
+
553
+ builder.Append(']');
554
+ }
555
+
556
+ void SerializeString(string str)
557
+ {
558
+ builder.Append('\"');
559
+
560
+ char[] charArray = str.ToCharArray();
561
+ foreach (var c in charArray)
562
+ {
563
+ switch (c)
564
+ {
565
+ case '"':
566
+ builder.Append("\\\"");
567
+ break;
568
+ case '\\':
569
+ builder.Append("\\\\");
570
+ break;
571
+ case '\b':
572
+ builder.Append("\\b");
573
+ break;
574
+ case '\f':
575
+ builder.Append("\\f");
576
+ break;
577
+ case '\n':
578
+ builder.Append("\\n");
579
+ break;
580
+ case '\r':
581
+ builder.Append("\\r");
582
+ break;
583
+ case '\t':
584
+ builder.Append("\\t");
585
+ break;
586
+ default:
587
+ int codepoint = Convert.ToInt32(c);
588
+ if ((codepoint >= 32) && (codepoint <= 126))
589
+ {
590
+ builder.Append(c);
591
+ }
592
+ else
593
+ {
594
+ builder.Append("\\u");
595
+ builder.Append(codepoint.ToString("x4"));
596
+ }
597
+ break;
598
+ }
599
+ }
600
+
601
+ builder.Append('\"');
602
+ }
603
+
604
+ void SerializeOther(object value)
605
+ {
606
+ // NOTE: decimals lose precision during serialization.
607
+ // They always have, I'm just letting you know.
608
+ // Previously floats and doubles lost precision too.
609
+ if (value is float)
610
+ {
611
+ builder.Append(((float)value).ToString("R", CultureInfo.InvariantCulture));
612
+ }
613
+ else if (value is int
614
+ || value is uint
615
+ || value is long
616
+ || value is sbyte
617
+ || value is byte
618
+ || value is short
619
+ || value is ushort
620
+ || value is ulong)
621
+ {
622
+ builder.Append(value);
623
+ }
624
+ else if (value is double
625
+ || value is decimal)
626
+ {
627
+ builder.Append(Convert.ToDouble(value).ToString("R", CultureInfo.InvariantCulture));
628
+ }
629
+ else
630
+ {
631
+ SerializeString(value.ToString());
632
+ }
633
+ }
634
+ }
635
+ }
636
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 03626f52014bc4f14b549e8bb318ca74
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,7 @@
1
+ namespace TapSDK.Core {
2
+ public enum TapLogLevel {
3
+ Debug,
4
+ Warn,
5
+ Error,
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 1456af90a56064fe9afe2ccd9692f261
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: