commit 25d0be56b727cecd600b9e758a98087768e37bd0 Author: ci-gitlab Date: Mon Oct 23 15:17:12 2023 +0800 feat:update upm diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..63bff00 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,110 @@ +# ChangeLog + +## 3.11.1 + +### Fixed bugs +- iOS: 修复授权模块对系统 URL 回调的使用方式 + +## 3.11.0 + +## 3.10.0 + +## 3.9.0 + +## 3.8.0 + +## 3.7.1 + +## 3.7.0 + +## 3.6.3 + +### Optimization and fixed bugs +- Android 修复特定机型上繁体中文的识别 +- Android 修复初始化时未配置 TapDBConfig 会初始化失败的问题 + +## 3.6.1 + +## 3.6.0 + +## 3.5.2 + +### New Feature +- 新增多语言配置 + +## 3.5.0 + +### Optimization and fixed bugs +- 支持性更新 + +## 3.4.0 + +## 3.3.0 + +- Native Update + +## 3.2.0 + +- Native Update + +## 3.1.0 + +- Native Update + +## 3.0.0 + +### Optimization + +- Bridge 新增 Task 桥接 + +## 2.1.7 + +### None + +## 2.1.6 + +### BreakingChanges + +- 修改 **TapCommon.OpenReviewInTapGlobal()** 方法命名 + +## 2.1.5 + +### Optimization and fixed bugs + +- 内部优化 + +## 2.1.4 + +### Optimization and fixed bugs + +- 优化多语言相关 +- 修复 JSON 解析错误 + +## 2.1.3 + +### New Feature + +* iOS 新增 TapTap 以及 Tap.IO 客户端安装判断 + +## 2.1.2 + +### Optimization and fixed bugs + +* 修复 iOS ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 设置问题可能导致的 AppStore 审核无法通过 + +## 2.1.1 + +### Feature + +* Android 新增 TapTap App 相关支持功能 + +## 2.1.0 + +* 新增长链接支持 TapTap.Friends +* 海内外域名切换 + +## 2.0.0 + +### Feature + +* TapTap Common \ No newline at end of file diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..904fb55 --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 89a2f2ba3f4d4cf0b55f2f992c6b6afb +timeCreated: 1616744142 \ No newline at end of file diff --git a/Documentation.meta b/Documentation.meta new file mode 100644 index 0000000..345bff8 --- /dev/null +++ b/Documentation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e5655844e77cd49d8a69c4a299e31419 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation/Bridge.md b/Documentation/Bridge.md new file mode 100644 index 0000000..920447b --- /dev/null +++ b/Documentation/Bridge.md @@ -0,0 +1,178 @@ +# TapCommon 用于支持 TapSDK 其他模块中 Android、iOS 与 Unity 的通信 + +> 目前 TapSDK 业务中,Unity 业务层实现的功能不多,主要作为桥接来调用 Android、iOS SDK 中的方法。 + +## 一、实现 Unity 调用 Android、iOS 方法 + +> 为了方便 Unity 一套代码可以调用双端方法,所以定义原生接口时,需要考虑 Android、iOS 语言之间的差异。 + +### Android 接口定义 + +- 使用 `@BridgeService` 、`@BridgeMethod` 、`@BridgeParam` 注解修饰 `类`、`方法`、`参数`。 +- `Activity`、`BridgeCallback` 这两个类型参数不需要 `@BridgeParam` 注解。 +- `@BridgeParam` 仅支持基本数据类型(包含 `String`)。 + +```java +@BridgeService("TestService") +public class TestService implementation IBridgeService { + + @BridgeMethod("testMethodWithCallback") + void testMethodWithCallback(BridgeCallback callback); + + @BridgeMethod("testMethodWithArgsAndCallback") + void testMethodWithArgsAndCallback(Activity activity, @BridgeParam("args1") String appId, @BridgeParam("args2") int args2, BridgeCallback callback); + +} + +``` + +### Android 接口实现 + +```java +public class TestService implementation TestService { + + @Override + public void testMethodWithCallback(BridgeCallback callback){ + callback.onResult("testMethodWithCallback 回调给 Unity 的参数"); + } + + @Override + public void testMethodWithArgsAndCallback(Activity activity, String appId,int args2, BridgeCallback callback){ + callback.onResult("testMethodWithArgsAndCallback 回调给 Unity 的参数"); + } + +} + +``` + +### iOS 接口定义 + +> iOS 方法名通过反射获取到的为 `args1:args2:bridgeCallback` ,所以 iOS 的方法定义与 Android 略有不同。 + +- 类名必须同 Android `@BridgeService` 所修饰的类名一致。 +- 参数名例如 `args1`、`args2` 必须同 Android `@BridgeParam` 修饰的一致,用于回调的 `iOS` 闭包的参数名必须为 `bridgeCallback`。 +- 当参数个数仅为 0 或者 仅为 闭包时,方法名必须同 Android `@BridgeMethod` 修饰的方法一致。 + +```objectivec +@interface TestService + +// 匹配的是 Android 中 testMethodWithCallback 方法 ++(void) testMethodWithCallback:(void (^)(NSString *result))callback; + +// 匹配的是 Android 中 testMethodWithArgsAndCallback 方法 ++(void) args1:(NSString*)args1 args2:(NSNumber*)args2 bridgeCallback:(void (^)(NSString *result))callback; + +@end +``` + +### iOS 接口实现 + +```objectivec +@implementation TestService + ++(void) testMethodWithCallback:(void (^)(NSString *result)) callback{ + callback(@"testMethodWithCallback 回调给 Unity 的参数"); +} + ++(void) args1:(NSString*)args1 args2:(NSNumber*)args2 bridgeCallback:(void (^)(NSString *result))callback{ + callback(@"testMethodWithArgsAndCallback 回调给 Unity 的参数"); +} + +@end +``` + +### Unity 调用上文中定义的 Android、iOS 接口 + +#### 1.初始化 + +```c# +// Android 初始化 +//CLZ_NAME 和IMP_NAME为 接口以及实现类的全路径包名 例如:com.tds.bridge.TestService,com.tds.bridge.TestServiceImpl +EngineBridge.GetInstance().Register(CLZ_NAME, IMP_NAME); + +// iOS 无需初始化 +``` +#### 2.调用方法 + +`Bridge.CallHandler` 为异步方法,执行线程的流程为: + +Unity Thread -> Native MainThread -> Execute Function -> Unity Thread + +所以执行 `CallHandler` 的 Thread 和 `Action` 的 Thread 都为 Unity 当前 Thread。 + +```c# + var command = new Command.Builder() + .Service("TestService") // @BridgeService 值以及 iOS 类名 + .Method("testMethodWithArgsAndCallback") // @BridgeMethod 值 以及 iOS 方法名 + .Args("args1","value") // @BridgeParam 值 以及 iOS 参数名 + .Args("args2",1) // 同上 + .Callback(true) // 是否需要添加 BridgeCallback + .OnceTime(true) // 当前 BridgeCallback 是否常驻内存 + .CommandBuilder(); + + // 需要回调 + EngineBridge.GetInstance().CallHandler(command,result=>{ + if(EngineBridge.CheckResult(result)){ + // 桥接调用成功 + // 当前 Content 则为 Android、iOS 通过 BridgeCallback 传给 Unity 的值 + var content = result.content; + } + }); + + // 不需要回调 + EngineBridge.GetInstance().CallHandler(command); +``` + +## 二、Android 、iOS 调用 Unity + +鉴于 TapSDK 3.1.+ 之后,Android 与 iOS 需要同步 `TapBootstrap` 中 `TDSUser` 的部分参数,所以 `TapCommon` 在当前版本支持了原生简单的调用 Unity 接口。 + +以下以 Android、iOS 需要 Unity 提供 `sessionToken` 以及 `objectId` 为例 + +### Unity 实现 ITapPropertiesProxy 接口并注册 + +```c# +public class SessionTokenProxy:ITapPropertiesProxy{ + + public string GetProperties(){ + return "sessionToken-kafjaskldfjasjdhfajkdfajdfas"; + } + +} + +public class ObjectIdProxy:ITapPropertiesProxy { + + public string GetProperties(){ + return "objectId-dafasdfad"; + } + +} + +// 通过 TapCommon 注册 Native 需要调用的接口 +TapCommon.RegisterProperties("sessionToken",new SessionTokenProxy()); + +TapCommon.RegisterProperties("objectid",new ObjectIdProxy()); +``` + +### Android、iOS 调用 Unity 实现的 ITapPropertiesProxy 来获取所需要的值 + +Android 获取 `sessionToken` 以及 `objectId` + +```java +String sessionToken = TapPropertiesHolder.INSTANCE.getProperty("sessionToken"); +String objectId = TapPropertiesHolder.INSTANCE.getProperty("objectId"); +``` + +iOS 获取 `sessionToken` 以及 `objectId` + +```objectivec +NSString* sessionToken = [[TapPropertiesHolder shareInstance] getProperty:@"sessionToken"]; +NSString* objectId = [[TapPropertiesHolder shareInstance] getProperty:@"objectId"]; +``` + + + + + + + diff --git a/Documentation/Bridge.md.meta b/Documentation/Bridge.md.meta new file mode 100644 index 0000000..e8f8eec --- /dev/null +++ b/Documentation/Bridge.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c2be0874429944a43820d92aa06185f4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation/README.md b/Documentation/README.md new file mode 100644 index 0000000..bf7679e --- /dev/null +++ b/Documentation/README.md @@ -0,0 +1,89 @@ +## TapTap.Common + +### 接口描述 + +#### 1.获取地区 + +```c# +TapCommon.GetRegionCode(isMainland => +{ + // true 中国大陆 false 非中国大陆 +}); +``` + +#### 2. TapTap 是否安装 + +```c# +TapCommon.IsTapTapInstalled(installed => +{ + // true 安装 false 未安装 +}); +``` + +#### 3. TapTap IO 是否安装 + +```c# +TapCommon.IsTapTapGlobalInstalled(installed => +{ + // true 安装 false 未安装 +}); +``` + +### Android 独占方法 + +#### 4. 在 TapTap 更新游戏 + +```c# +TapCommon.UpdateGameInTapTap(appId,updateSuccess => +{ + // true 更新成功 false 更新失败 +}); +``` + +#### 5. 在 TapTap IO 更新游戏 + +```c# +TapCommon.UpdateGameInTapGlobal(appId,updateSuccess => +{ + // true 更新成功 false 更新失败 +}); +``` + +#### 6. 在 TapTap 打开当前游戏的评论区 + +```c# +TapCommon.OpenReviewInTapTap(appId,openSuccess => +{ + // true 打开评论区 false 打开失败 +}); +``` + +#### 6. 在 TapTap IO 打开当前游戏的评论区 + +```c# +TapCommon.OpenReviewInTapGlobal(appId,openSuccess => +{ + // true 打开评论区 false 打开失败 +}); +``` + +#### 7. 唤起 TapTap 客户端更新游戏 + +appId: 游戏在 TapTap 商店的唯一身份标识 + +例如:https://www.taptap.com/app/187168 ,其中 187168 是 appid. + +```c# +// 在 TapTap 客户端更新游戏,失败时通过浏览器打开 Tap 网站对应的游戏页面 +// 当你在国内区上架时使用 +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapTap(string appId); +// 当你在海外区上架时使用 +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapGlobal(string appId): +``` + +如果你需要在唤起 Tap 客户端失败时跳转到自己的网页 + +```c# +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapTap(string appId, string webUrl) +bool isSuccess = await TapCommon.UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl) +``` \ No newline at end of file diff --git a/Documentation/README.md.meta b/Documentation/README.md.meta new file mode 100644 index 0000000..1a6d5ca --- /dev/null +++ b/Documentation/README.md.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1d7008a3a22e45a4bfe9605e6d050a29 +timeCreated: 1616744132 \ No newline at end of file diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..323556b --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28e2e71fed1414ad3978a4e5575065f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/BuildTargetUtils.cs b/Editor/BuildTargetUtils.cs new file mode 100644 index 0000000..f50f379 --- /dev/null +++ b/Editor/BuildTargetUtils.cs @@ -0,0 +1,14 @@ +using UnityEditor; + +namespace TapTap.Common.Editor { + public static class BuildTargetUtils { + public static bool IsSupportMobile(BuildTarget platform) { + return platform == BuildTarget.iOS || platform == BuildTarget.Android; + } + + public static bool IsSupportStandalone(BuildTarget platform) { + return platform == BuildTarget.StandaloneOSX || + platform == BuildTarget.StandaloneWindows || platform == BuildTarget.StandaloneWindows64; + } + } +} diff --git a/Editor/BuildTargetUtils.cs.meta b/Editor/BuildTargetUtils.cs.meta new file mode 100644 index 0000000..1d96eac --- /dev/null +++ b/Editor/BuildTargetUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da005b5e251334d388fe38e6978890cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/LinkXMLGenerator.cs b/Editor/LinkXMLGenerator.cs new file mode 100644 index 0000000..06fdb52 --- /dev/null +++ b/Editor/LinkXMLGenerator.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using System.IO; +using System.Xml; +using UnityEngine; +using UnityEditor; + +namespace TapTap.Common.Editor { + public class LinkedAssembly { + public string Fullname { get; set; } + public string[] Types { get; set; } + } + + public class LinkXMLGenerator { + public static void Generate(string path, IEnumerable assemblies) { + DirectoryInfo parent = Directory.GetParent(path); + if (!parent.Exists) { + Directory.CreateDirectory(parent.FullName); + } + + XmlDocument doc = new XmlDocument(); + + XmlNode rootNode = doc.CreateElement("linker"); + doc.AppendChild(rootNode); + + foreach (LinkedAssembly assembly in assemblies) { + XmlNode assemblyNode = doc.CreateElement("assembly"); + + XmlAttribute fullnameAttr = doc.CreateAttribute("fullname"); + fullnameAttr.Value = assembly.Fullname; + assemblyNode.Attributes.Append(fullnameAttr); + + if (assembly.Types?.Length > 0) { + foreach (string type in assembly.Types) { + XmlNode typeNode = doc.CreateElement("type"); + XmlAttribute typeFullnameAttr = doc.CreateAttribute("fullname"); + typeFullnameAttr.Value = type; + typeNode.Attributes.Append(typeFullnameAttr); + + XmlAttribute typePreserveAttr = doc.CreateAttribute("preserve"); + typePreserveAttr.Value = "all"; + typeNode.Attributes.Append(typePreserveAttr); + + assemblyNode.AppendChild(typeNode); + } + } else { + XmlAttribute preserveAttr = doc.CreateAttribute("preserve"); + preserveAttr.Value = "all"; + assemblyNode.Attributes.Append(preserveAttr); + } + + rootNode.AppendChild(assemblyNode); + } + + doc.Save(path); + AssetDatabase.Refresh(); + + Debug.Log($"Generate {path} done."); + Debug.Log(doc.OuterXml); + } + + public static void Delete(string path) { + if (File.Exists(path)) { + File.Delete(path); + AssetDatabase.Refresh(); + } + + Debug.Log($"Delete {path} done."); + } + } +} diff --git a/Editor/LinkXMLGenerator.cs.meta b/Editor/LinkXMLGenerator.cs.meta new file mode 100644 index 0000000..0467446 --- /dev/null +++ b/Editor/LinkXMLGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c63ed7a6afba54761aca6c388df097e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Plist.cs b/Editor/Plist.cs new file mode 100644 index 0000000..e4bed47 --- /dev/null +++ b/Editor/Plist.cs @@ -0,0 +1,954 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; + +namespace TapTap.Common.Editor +{ + public static class Plist + { + private static List offsetTable = new List(); + private static List objectTable = new List(); + private static int refCount; + private static int objRefSize; + private static int offsetByteSize; + private static long offsetTableOffset; + + #region Public Functions + + public static object readPlist(string path) + { + using (FileStream f = new FileStream(path, FileMode.Open, FileAccess.Read)) + { + return readPlist(f, plistType.Auto); + } + } + + public static object readPlistSource(string source) + { + return readPlist(System.Text.Encoding.UTF8.GetBytes(source)); + } + + public static object readPlist(byte[] data) + { + return readPlist(new MemoryStream(data), plistType.Auto); + } + + public static plistType getPlistType(Stream stream) + { + byte[] magicHeader = new byte[8]; + stream.Read(magicHeader, 0, 8); + + if (BitConverter.ToInt64(magicHeader, 0) == 3472403351741427810) + { + return plistType.Binary; + } + else + { + return plistType.Xml; + } + } + + public static object readPlist(Stream stream, plistType type) + { + if (type == plistType.Auto) + { + type = getPlistType(stream); + stream.Seek(0, SeekOrigin.Begin); + } + + if (type == plistType.Binary) + { + using (BinaryReader reader = new BinaryReader(stream)) + { + byte[] data = reader.ReadBytes((int) reader.BaseStream.Length); + return readBinary(data); + } + } + else + { + XmlDocument xml = new XmlDocument(); + xml.XmlResolver = null; + xml.Load(stream); + return readXml(xml); + } + } + + public static void writeXml(object value, string path) + { + using (StreamWriter writer = new StreamWriter(path)) + { + writer.Write(writeXml(value)); + } + } + + public static void writeXml(object value, Stream stream) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + writer.Write(writeXml(value)); + } + } + + public static string writeXml(object value) + { + using (MemoryStream ms = new MemoryStream()) + { + XmlWriterSettings xmlWriterSettings = new XmlWriterSettings(); + xmlWriterSettings.Encoding = new System.Text.UTF8Encoding(false); + xmlWriterSettings.ConformanceLevel = ConformanceLevel.Document; + xmlWriterSettings.Indent = true; + + using (XmlWriter xmlWriter = XmlWriter.Create(ms, xmlWriterSettings)) + { + xmlWriter.WriteStartDocument(); + //xmlWriter.WriteComment("DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " + "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\""); + xmlWriter.WriteDocType("plist", "-//Apple Computer//DTD PLIST 1.0//EN", + "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null); + xmlWriter.WriteStartElement("plist"); + xmlWriter.WriteAttributeString("version", "1.0"); + compose(value, xmlWriter); + xmlWriter.WriteEndElement(); + xmlWriter.WriteEndDocument(); + xmlWriter.Flush(); + xmlWriter.Close(); + return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + } + } + } + + public static void writeBinary(object value, string path) + { + using (BinaryWriter writer = new BinaryWriter(new FileStream(path, FileMode.Create))) + { + writer.Write(writeBinary(value)); + } + } + + public static void writeBinary(object value, Stream stream) + { + using (BinaryWriter writer = new BinaryWriter(stream)) + { + writer.Write(writeBinary(value)); + } + } + + public static byte[] writeBinary(object value) + { + offsetTable.Clear(); + objectTable.Clear(); + refCount = 0; + objRefSize = 0; + offsetByteSize = 0; + offsetTableOffset = 0; + + //Do not count the root node, subtract by 1 + int totalRefs = countObject(value) - 1; + + refCount = totalRefs; + + objRefSize = RegulateNullBytes(BitConverter.GetBytes(refCount)).Length; + + composeBinary(value); + + writeBinaryString("bplist00", false); + + offsetTableOffset = (long) objectTable.Count; + + offsetTable.Add(objectTable.Count - 8); + + offsetByteSize = RegulateNullBytes(BitConverter.GetBytes(offsetTable[offsetTable.Count - 1])).Length; + + List offsetBytes = new List(); + + offsetTable.Reverse(); + + for (int i = 0; i < offsetTable.Count; i++) + { + offsetTable[i] = objectTable.Count - offsetTable[i]; + byte[] buffer = RegulateNullBytes(BitConverter.GetBytes(offsetTable[i]), offsetByteSize); + Array.Reverse(buffer); + offsetBytes.AddRange(buffer); + } + + objectTable.AddRange(offsetBytes); + + objectTable.AddRange(new byte[6]); + objectTable.Add(Convert.ToByte(offsetByteSize)); + objectTable.Add(Convert.ToByte(objRefSize)); + + var a = BitConverter.GetBytes((long) totalRefs + 1); + Array.Reverse(a); + objectTable.AddRange(a); + + objectTable.AddRange(BitConverter.GetBytes((long) 0)); + a = BitConverter.GetBytes(offsetTableOffset); + Array.Reverse(a); + objectTable.AddRange(a); + + return objectTable.ToArray(); + } + + #endregion + + #region Private Functions + + private static object readXml(XmlDocument xml) + { + XmlNode rootNode = xml.DocumentElement.ChildNodes[0]; + return parse(rootNode); + } + + private static object readBinary(byte[] data) + { + offsetTable.Clear(); + List offsetTableBytes = new List(); + objectTable.Clear(); + refCount = 0; + objRefSize = 0; + offsetByteSize = 0; + offsetTableOffset = 0; + + List bList = new List(data); + + List trailer = bList.GetRange(bList.Count - 32, 32); + + parseTrailer(trailer); + + objectTable = bList.GetRange(0, (int) offsetTableOffset); + + offsetTableBytes = bList.GetRange((int) offsetTableOffset, bList.Count - (int) offsetTableOffset - 32); + + parseOffsetTable(offsetTableBytes); + + return parseBinary(0); + } + + private static Dictionary parseDictionary(XmlNode node) + { + XmlNodeList children = node.ChildNodes; + if (children.Count % 2 != 0) + { + throw new DataMisalignedException("Dictionary elements must have an even number of child nodes"); + } + + Dictionary dict = new Dictionary(); + + for (int i = 0; i < children.Count; i += 2) + { + XmlNode keynode = children[i]; + XmlNode valnode = children[i + 1]; + + if (keynode.Name != "key") + { + throw new ApplicationException("expected a key node"); + } + + object result = parse(valnode); + + if (result != null) + { + dict.Add(keynode.InnerText, result); + } + } + + return dict; + } + + private static List parseArray(XmlNode node) + { + List array = new List(); + + foreach (XmlNode child in node.ChildNodes) + { + object result = parse(child); + if (result != null) + { + array.Add(result); + } + } + + return array; + } + + private static void composeArray(List value, XmlWriter writer) + { + writer.WriteStartElement("array"); + foreach (object obj in value) + { + compose(obj, writer); + } + + writer.WriteEndElement(); + } + + private static object parse(XmlNode node) + { + switch (node.Name) + { + case "dict": + return parseDictionary(node); + case "array": + return parseArray(node); + case "string": + return node.InnerText; + case "integer": + // int result; + //int.TryParse(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo, out result); + return Convert.ToInt32(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo); + case "real": + return Convert.ToDouble(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo); + case "false": + return false; + case "true": + return true; + case "null": + return null; + case "date": + return XmlConvert.ToDateTime(node.InnerText, XmlDateTimeSerializationMode.Utc); + case "data": + return Convert.FromBase64String(node.InnerText); + } + + throw new ApplicationException(String.Format("Plist Node `{0}' is not supported", node.Name)); + } + + private static void compose(object value, XmlWriter writer) + { + if (value == null || value is string) + { + writer.WriteElementString("string", value as string); + } + else if (value is int || value is long) + { + writer.WriteElementString("integer", + ((int) value).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); + } + else if (value is System.Collections.Generic.Dictionary || + value.GetType().ToString().StartsWith("System.Collections.Generic.Dictionary`2[System.String")) + { + //Convert to Dictionary + Dictionary dic = value as Dictionary; + if (dic == null) + { + dic = new Dictionary(); + IDictionary idic = (IDictionary) value; + foreach (var key in idic.Keys) + { + dic.Add(key.ToString(), idic[key]); + } + } + + writeDictionaryValues(dic, writer); + } + else if (value is List) + { + composeArray((List) value, writer); + } + else if (value is byte[]) + { + writer.WriteElementString("data", Convert.ToBase64String((Byte[]) value)); + } + else if (value is float || value is double) + { + writer.WriteElementString("real", + ((double) value).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); + } + else if (value is DateTime) + { + DateTime time = (DateTime) value; + string theString = XmlConvert.ToString(time, XmlDateTimeSerializationMode.Utc); + writer.WriteElementString("date", theString); //, "yyyy-MM-ddTHH:mm:ssZ")); + } + else if (value is bool) + { + writer.WriteElementString(value.ToString().ToLower(), ""); + } + else + { + throw new Exception(String.Format("Value type '{0}' is unhandled", value.GetType().ToString())); + } + } + + private static void writeDictionaryValues(Dictionary dictionary, XmlWriter writer) + { + writer.WriteStartElement("dict"); + foreach (string key in dictionary.Keys) + { + object value = dictionary[key]; + writer.WriteElementString("key", key); + compose(value, writer); + } + + writer.WriteEndElement(); + } + + private static int countObject(object value) + { + int count = 0; + switch (value.GetType().ToString()) + { + case "System.Collections.Generic.Dictionary`2[System.String,System.Object]": + Dictionary dict = (Dictionary) value; + foreach (string key in dict.Keys) + { + count += countObject(dict[key]); + } + + count += dict.Keys.Count; + count++; + break; + case "System.Collections.Generic.List`1[System.Object]": + List list = (List) value; + foreach (object obj in list) + { + count += countObject(obj); + } + + count++; + break; + default: + count++; + break; + } + + return count; + } + + private static byte[] writeBinaryDictionary(Dictionary dictionary) + { + List buffer = new List(); + List header = new List(); + List refs = new List(); + for (int i = dictionary.Count - 1; i >= 0; i--) + { + var o = new object[dictionary.Count]; + dictionary.Values.CopyTo(o, 0); + composeBinary(o[i]); + offsetTable.Add(objectTable.Count); + refs.Add(refCount); + refCount--; + } + + for (int i = dictionary.Count - 1; i >= 0; i--) + { + var o = new string[dictionary.Count]; + dictionary.Keys.CopyTo(o, 0); + composeBinary(o[i]); //); + offsetTable.Add(objectTable.Count); + refs.Add(refCount); + refCount--; + } + + if (dictionary.Count < 15) + { + header.Add(Convert.ToByte(0xD0 | Convert.ToByte(dictionary.Count))); + } + else + { + header.Add(0xD0 | 0xf); + header.AddRange(writeBinaryInteger(dictionary.Count, false)); + } + + + foreach (int val in refs) + { + byte[] refBuffer = RegulateNullBytes(BitConverter.GetBytes(val), objRefSize); + Array.Reverse(refBuffer); + buffer.InsertRange(0, refBuffer); + } + + buffer.InsertRange(0, header); + + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] composeBinaryArray(List objects) + { + List buffer = new List(); + List header = new List(); + List refs = new List(); + + for (int i = objects.Count - 1; i >= 0; i--) + { + composeBinary(objects[i]); + offsetTable.Add(objectTable.Count); + refs.Add(refCount); + refCount--; + } + + if (objects.Count < 15) + { + header.Add(Convert.ToByte(0xA0 | Convert.ToByte(objects.Count))); + } + else + { + header.Add(0xA0 | 0xf); + header.AddRange(writeBinaryInteger(objects.Count, false)); + } + + foreach (int val in refs) + { + byte[] refBuffer = RegulateNullBytes(BitConverter.GetBytes(val), objRefSize); + Array.Reverse(refBuffer); + buffer.InsertRange(0, refBuffer); + } + + buffer.InsertRange(0, header); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] composeBinary(object obj) + { + byte[] value; + switch (obj.GetType().ToString()) + { + case "System.Collections.Generic.Dictionary`2[System.String,System.Object]": + value = writeBinaryDictionary((Dictionary) obj); + return value; + + case "System.Collections.Generic.List`1[System.Object]": + value = composeBinaryArray((List) obj); + return value; + + case "System.Byte[]": + value = writeBinaryByteArray((byte[]) obj); + return value; + + case "System.Double": + value = writeBinaryDouble((double) obj); + return value; + + case "System.Int32": + value = writeBinaryInteger((int) obj, true); + return value; + + case "System.String": + value = writeBinaryString((string) obj, true); + return value; + + case "System.DateTime": + value = writeBinaryDate((DateTime) obj); + return value; + + case "System.Boolean": + value = writeBinaryBool((bool) obj); + return value; + + default: + return new byte[0]; + } + } + + public static byte[] writeBinaryDate(DateTime obj) + { + List buffer = + new List(RegulateNullBytes(BitConverter.GetBytes(PlistDateConverter.ConvertToAppleTimeStamp(obj)), + 8)); + buffer.Reverse(); + buffer.Insert(0, 0x33); + objectTable.InsertRange(0, buffer); + return buffer.ToArray(); + } + + public static byte[] writeBinaryBool(bool obj) + { + List buffer = new List(new byte[1] {(bool) obj ? (byte) 9 : (byte) 8}); + objectTable.InsertRange(0, buffer); + return buffer.ToArray(); + } + + private static byte[] writeBinaryInteger(int value, bool write) + { + List buffer = new List(BitConverter.GetBytes((long) value)); + buffer = new List(RegulateNullBytes(buffer.ToArray())); + while (buffer.Count != Math.Pow(2, Math.Log(buffer.Count) / Math.Log(2))) + buffer.Add(0); + int header = 0x10 | (int) (Math.Log(buffer.Count) / Math.Log(2)); + + buffer.Reverse(); + + buffer.Insert(0, Convert.ToByte(header)); + + if (write) + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] writeBinaryDouble(double value) + { + List buffer = new List(RegulateNullBytes(BitConverter.GetBytes(value), 4)); + while (buffer.Count != Math.Pow(2, Math.Log(buffer.Count) / Math.Log(2))) + buffer.Add(0); + int header = 0x20 | (int) (Math.Log(buffer.Count) / Math.Log(2)); + + buffer.Reverse(); + + buffer.Insert(0, Convert.ToByte(header)); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] writeBinaryByteArray(byte[] value) + { + List buffer = new List(value); + List header = new List(); + if (value.Length < 15) + { + header.Add(Convert.ToByte(0x40 | Convert.ToByte(value.Length))); + } + else + { + header.Add(0x40 | 0xf); + header.AddRange(writeBinaryInteger(buffer.Count, false)); + } + + buffer.InsertRange(0, header); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] writeBinaryString(string value, bool head) + { + List buffer = new List(); + List header = new List(); + foreach (char chr in value.ToCharArray()) + buffer.Add(Convert.ToByte(chr)); + + if (head) + { + if (value.Length < 15) + { + header.Add(Convert.ToByte(0x50 | Convert.ToByte(value.Length))); + } + else + { + header.Add(0x50 | 0xf); + header.AddRange(writeBinaryInteger(buffer.Count, false)); + } + } + + buffer.InsertRange(0, header); + + objectTable.InsertRange(0, buffer); + + return buffer.ToArray(); + } + + private static byte[] RegulateNullBytes(byte[] value) + { + return RegulateNullBytes(value, 1); + } + + private static byte[] RegulateNullBytes(byte[] value, int minBytes) + { + Array.Reverse(value); + List bytes = new List(value); + for (int i = 0; i < bytes.Count; i++) + { + if (bytes[i] == 0 && bytes.Count > minBytes) + { + bytes.Remove(bytes[i]); + i--; + } + else + break; + } + + if (bytes.Count < minBytes) + { + int dist = minBytes - bytes.Count; + for (int i = 0; i < dist; i++) + bytes.Insert(0, 0); + } + + value = bytes.ToArray(); + Array.Reverse(value); + return value; + } + + private static void parseTrailer(List trailer) + { + offsetByteSize = BitConverter.ToInt32(RegulateNullBytes(trailer.GetRange(6, 1).ToArray(), 4), 0); + objRefSize = BitConverter.ToInt32(RegulateNullBytes(trailer.GetRange(7, 1).ToArray(), 4), 0); + byte[] refCountBytes = trailer.GetRange(12, 4).ToArray(); + Array.Reverse(refCountBytes); + refCount = BitConverter.ToInt32(refCountBytes, 0); + byte[] offsetTableOffsetBytes = trailer.GetRange(24, 8).ToArray(); + Array.Reverse(offsetTableOffsetBytes); + offsetTableOffset = BitConverter.ToInt64(offsetTableOffsetBytes, 0); + } + + private static void parseOffsetTable(List offsetTableBytes) + { + for (int i = 0; i < offsetTableBytes.Count; i += offsetByteSize) + { + byte[] buffer = offsetTableBytes.GetRange(i, offsetByteSize).ToArray(); + Array.Reverse(buffer); + offsetTable.Add(BitConverter.ToInt32(RegulateNullBytes(buffer, 4), 0)); + } + } + + private static object parseBinaryDictionary(int objRef) + { + Dictionary buffer = new Dictionary(); + List refs = new List(); + int refCount = 0; + + int refStartPosition; + refCount = getCount(offsetTable[objRef], out refStartPosition); + + + if (refCount < 15) + refStartPosition = offsetTable[objRef] + 1; + else + refStartPosition = offsetTable[objRef] + 2 + + RegulateNullBytes(BitConverter.GetBytes(refCount), 1).Length; + + for (int i = refStartPosition; i < refStartPosition + refCount * 2 * objRefSize; i += objRefSize) + { + byte[] refBuffer = objectTable.GetRange(i, objRefSize).ToArray(); + Array.Reverse(refBuffer); + refs.Add(BitConverter.ToInt32(RegulateNullBytes(refBuffer, 4), 0)); + } + + for (int i = 0; i < refCount; i++) + { + buffer.Add((string) parseBinary(refs[i]), parseBinary(refs[i + refCount])); + } + + return buffer; + } + + private static object parseBinaryArray(int objRef) + { + List buffer = new List(); + List refs = new List(); + int refCount = 0; + + int refStartPosition; + refCount = getCount(offsetTable[objRef], out refStartPosition); + + + if (refCount < 15) + refStartPosition = offsetTable[objRef] + 1; + else + //The following integer has a header aswell so we increase the refStartPosition by two to account for that. + refStartPosition = offsetTable[objRef] + 2 + + RegulateNullBytes(BitConverter.GetBytes(refCount), 1).Length; + + for (int i = refStartPosition; i < refStartPosition + refCount * objRefSize; i += objRefSize) + { + byte[] refBuffer = objectTable.GetRange(i, objRefSize).ToArray(); + Array.Reverse(refBuffer); + refs.Add(BitConverter.ToInt32(RegulateNullBytes(refBuffer, 4), 0)); + } + + for (int i = 0; i < refCount; i++) + { + buffer.Add(parseBinary(refs[i])); + } + + return buffer; + } + + private static int getCount(int bytePosition, out int newBytePosition) + { + byte headerByte = objectTable[bytePosition]; + byte headerByteTrail = Convert.ToByte(headerByte & 0xf); + int count; + if (headerByteTrail < 15) + { + count = headerByteTrail; + newBytePosition = bytePosition + 1; + } + else + count = (int) parseBinaryInt(bytePosition + 1, out newBytePosition); + + return count; + } + + private static object parseBinary(int objRef) + { + byte header = objectTable[offsetTable[objRef]]; + switch (header & 0xF0) + { + case 0: + { + //If the byte is + //0 return null + //9 return true + //8 return false + return (objectTable[offsetTable[objRef]] == 0) + ? (object) null + : ((objectTable[offsetTable[objRef]] == 9) ? true : false); + } + case 0x10: + { + return parseBinaryInt(offsetTable[objRef]); + } + case 0x20: + { + return parseBinaryReal(offsetTable[objRef]); + } + case 0x30: + { + return parseBinaryDate(offsetTable[objRef]); + } + case 0x40: + { + return parseBinaryByteArray(offsetTable[objRef]); + } + case 0x50: //String ASCII + { + return parseBinaryAsciiString(offsetTable[objRef]); + } + case 0x60: //String Unicode + { + return parseBinaryUnicodeString(offsetTable[objRef]); + } + case 0xD0: + { + return parseBinaryDictionary(objRef); + } + case 0xA0: + { + return parseBinaryArray(objRef); + } + } + + throw new Exception("This type is not supported"); + } + + public static object parseBinaryDate(int headerPosition) + { + byte[] buffer = objectTable.GetRange(headerPosition + 1, 8).ToArray(); + Array.Reverse(buffer); + double appleTime = BitConverter.ToDouble(buffer, 0); + DateTime result = PlistDateConverter.ConvertFromAppleTimeStamp(appleTime); + return result; + } + + private static object parseBinaryInt(int headerPosition) + { + int output; + return parseBinaryInt(headerPosition, out output); + } + + private static object parseBinaryInt(int headerPosition, out int newHeaderPosition) + { + byte header = objectTable[headerPosition]; + int byteCount = (int) Math.Pow(2, header & 0xf); + byte[] buffer = objectTable.GetRange(headerPosition + 1, byteCount).ToArray(); + Array.Reverse(buffer); + //Add one to account for the header byte + newHeaderPosition = headerPosition + byteCount + 1; + return BitConverter.ToInt32(RegulateNullBytes(buffer, 4), 0); + } + + private static object parseBinaryReal(int headerPosition) + { + byte header = objectTable[headerPosition]; + int byteCount = (int) Math.Pow(2, header & 0xf); + byte[] buffer = objectTable.GetRange(headerPosition + 1, byteCount).ToArray(); + Array.Reverse(buffer); + + return BitConverter.ToDouble(RegulateNullBytes(buffer, 8), 0); + } + + private static object parseBinaryAsciiString(int headerPosition) + { + int charStartPosition; + int charCount = getCount(headerPosition, out charStartPosition); + + var buffer = objectTable.GetRange(charStartPosition, charCount); + return buffer.Count > 0 ? Encoding.ASCII.GetString(buffer.ToArray()) : string.Empty; + } + + private static object parseBinaryUnicodeString(int headerPosition) + { + int charStartPosition; + int charCount = getCount(headerPosition, out charStartPosition); + charCount = charCount * 2; + + byte[] buffer = new byte[charCount]; + byte one, two; + + for (int i = 0; i < charCount; i += 2) + { + one = objectTable.GetRange(charStartPosition + i, 1)[0]; + two = objectTable.GetRange(charStartPosition + i + 1, 1)[0]; + + if (BitConverter.IsLittleEndian) + { + buffer[i] = two; + buffer[i + 1] = one; + } + else + { + buffer[i] = one; + buffer[i + 1] = two; + } + } + + return Encoding.Unicode.GetString(buffer); + } + + private static object parseBinaryByteArray(int headerPosition) + { + int byteStartPosition; + int byteCount = getCount(headerPosition, out byteStartPosition); + return objectTable.GetRange(byteStartPosition, byteCount).ToArray(); + } + + #endregion + } + + public enum plistType + { + Auto, + Binary, + Xml + } + + public static class PlistDateConverter + { + public static long timeDifference = 978307200; + + public static long GetAppleTime(long unixTime) + { + return unixTime - timeDifference; + } + + public static long GetUnixTime(long appleTime) + { + return appleTime + timeDifference; + } + + public static DateTime ConvertFromAppleTimeStamp(double timestamp) + { + DateTime origin = new DateTime(2001, 1, 1, 0, 0, 0, 0); + return origin.AddSeconds(timestamp); + } + + public static double ConvertToAppleTimeStamp(DateTime date) + { + DateTime begin = new DateTime(2001, 1, 1, 0, 0, 0, 0); + TimeSpan diff = date - begin; + return Math.Floor(diff.TotalSeconds); + } + } +} \ No newline at end of file diff --git a/Editor/Plist.cs.meta b/Editor/Plist.cs.meta new file mode 100644 index 0000000..a99b2d9 --- /dev/null +++ b/Editor/Plist.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 66eefeda055244c784769597b08e679e +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/SDKLinkProcessBuild.cs b/Editor/SDKLinkProcessBuild.cs new file mode 100644 index 0000000..23b6f3e --- /dev/null +++ b/Editor/SDKLinkProcessBuild.cs @@ -0,0 +1,119 @@ +using System; +using System.IO; +using UnityEngine; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; + +namespace TapTap.Common.Editor { + /// + /// 模块 SDK 生成 link.xml 构建过程 + /// + public abstract class SDKLinkProcessBuild : IPreprocessBuildWithReport, IPostprocessBuildWithReport { + /// + /// 执行顺序 + /// + public abstract int callbackOrder { get; } + + /// + /// 生成 link.xml 路径 + /// + public abstract string LinkPath { get; } + + /// + /// 防止被裁剪的 Assembly + /// + public abstract LinkedAssembly[] LinkedAssemblies { get; } + + /// + /// 执行平台委托 + /// + public abstract Func IsTargetPlatform { get; } + + /// + /// 构建时忽略目录,目前主要是 PC 内置浏览器 Vuplex + /// + public virtual string[] BuildingIgnorePaths => null; + + /// + /// 构建前处理 + /// + /// + public void OnPreprocessBuild(BuildReport report) { + if (!IsTargetPlatform.Invoke(report)) { + return; + } + + Application.logMessageReceived += OnBuildError; + IgnorePaths(); + + string linkPath = Path.Combine(Application.dataPath, LinkPath); + LinkXMLGenerator.Generate(linkPath, LinkedAssemblies); + } + + /// + /// 构建后处理 + /// + /// + public void OnPostprocessBuild(BuildReport report) { + if (!IsTargetPlatform.Invoke(report)) { + return; + } + + Application.logMessageReceived -= OnBuildError; + RecoverIgnoredPaths(); + + string linkPath = Path.Combine(Application.dataPath, LinkPath); + LinkXMLGenerator.Delete(linkPath); + } + + /// + /// 错误日志回调 + /// + /// + /// + /// + private void OnBuildError(string condition, string stacktrace, LogType logType) { + // TRICK: 通过捕获错误日志来监听打包错误事件 + if (logType == LogType.Error) { + Application.logMessageReceived -= OnBuildError; + RecoverIgnoredPaths(); + } + } + + /// + /// 忽略目录 + /// + private void IgnorePaths() { + if (BuildingIgnorePaths == null) { + return; + } + + foreach (string ignorePath in BuildingIgnorePaths) { + if (!Directory.Exists(Path.Combine(Application.dataPath, ignorePath))) { + continue; + } + string ignoreName = Path.GetFileName(ignorePath); + AssetDatabase.RenameAsset(Path.Combine("Assets", ignorePath), $"{ignoreName}~"); + } + } + + /// + /// 恢复目录 + /// + private void RecoverIgnoredPaths() { + if (BuildingIgnorePaths == null) { + return; + } + + foreach (string ignorePath in BuildingIgnorePaths) { + if (!Directory.Exists(Path.Combine(Application.dataPath, $"{ignorePath}~"))) { + continue; + } + Directory.Move(Path.Combine(Application.dataPath, $"{ignorePath}~"), + Path.Combine(Application.dataPath, $"{ignorePath}")); + AssetDatabase.ImportAsset(Path.Combine("Assets", ignorePath)); + } + } + } +} diff --git a/Editor/SDKLinkProcessBuild.cs.meta b/Editor/SDKLinkProcessBuild.cs.meta new file mode 100644 index 0000000..0d3cdf1 --- /dev/null +++ b/Editor/SDKLinkProcessBuild.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8566d22eb15da4629a4ae0deae37b0fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/TapCommonCompile.cs b/Editor/TapCommonCompile.cs new file mode 100644 index 0000000..6728164 --- /dev/null +++ b/Editor/TapCommonCompile.cs @@ -0,0 +1,263 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEngine; +#if UNITY_IOS +using System; +using UnityEditor.iOS.Xcode; + +#endif + +namespace TapTap.Common.Editor +{ + public static class TapCommonCompile + { +#if UNITY_IOS + public static string GetProjPath(string path) + { + return PBXProject.GetPBXProjectPath(path); + } + + public static PBXProject ParseProjPath(string path) + { + var proj = new PBXProject(); + proj.ReadFromString(File.ReadAllText(path)); + return proj; + } + + public static string GetUnityFrameworkTarget(PBXProject proj) + { +#if UNITY_2019_3_OR_NEWER + string target = proj.GetUnityFrameworkTargetGuid(); + return target; +#endif + var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone"); + return unityPhoneTarget; + } + + public static string GetUnityTarget(PBXProject proj) + { +#if UNITY_2019_3_OR_NEWER + string target = proj.GetUnityMainTargetGuid(); + return target; +#endif + var unityPhoneTarget = proj.TargetGuidByName("Unity-iPhone"); + return unityPhoneTarget; + } + + + public static bool CheckTarget(string target) + { + return string.IsNullOrEmpty(target); + } + + public static string GetUnityPackagePath(string parentFolder, string unityPackageName) { + var request = Client.List(true); + while(request.IsCompleted == false) { + System.Threading.Thread.Sleep(100); + } + var pkgs = request.Result; + if (pkgs == null) + return ""; + foreach (var pkg in pkgs) { + if (pkg.name == unityPackageName) { + if (pkg.source == PackageSource.Local) + return pkg.resolvedPath; + else if (pkg.source == PackageSource.Embedded) + return pkg.resolvedPath; + else { + return pkg.resolvedPath; + } + } + } + + return ""; + } + + public static bool HandlerIOSSetting(string path, string appDataPath, string resourceName, + string modulePackageName, + string moduleName, string[] bundleNames, string target, string projPath, PBXProject proj) + { + + var resourcePath = Path.Combine(path, resourceName); + + var parentFolder = Directory.GetParent(appDataPath).FullName; + + Debug.Log($"ProjectFolder path:{parentFolder}"); + + if (Directory.Exists(resourcePath)) + { + Directory.Delete(resourcePath, true); + } + + Directory.CreateDirectory(resourcePath); + + var remotePackagePath = GetUnityPackagePath(parentFolder, modulePackageName); + + var assetLocalPackagePath = TapFileHelper.FilterFileByPrefix(parentFolder + "/Assets/TapTap/", moduleName); + + var localPackagePath = TapFileHelper.FilterFileByPrefix(parentFolder, moduleName); + + var tdsResourcePath = ""; + + if (!string.IsNullOrEmpty(remotePackagePath)) + { + tdsResourcePath = remotePackagePath; + } + else if (!string.IsNullOrEmpty(assetLocalPackagePath)) + { + tdsResourcePath = assetLocalPackagePath; + } + else if (!string.IsNullOrEmpty(localPackagePath)) + { + tdsResourcePath = localPackagePath; + } + + if (string.IsNullOrEmpty(tdsResourcePath)) { + throw new Exception(string.Format("Can't find tdsResourcePath with module of : {0}", modulePackageName)); + } + + tdsResourcePath = $"{tdsResourcePath}/Plugins/iOS/Resource"; + + Debug.Log($"Find {moduleName} path:{tdsResourcePath}"); + + if (!Directory.Exists(tdsResourcePath)) { + throw new Exception(string.Format("Can't Find {0}", tdsResourcePath)); + } + + TapFileHelper.CopyAndReplaceDirectory(tdsResourcePath, resourcePath); + foreach (var name in bundleNames) { + var relativePath = GetRelativePath(Path.Combine(resourcePath, name), path); + var fileGuid = proj.AddFile(relativePath, relativePath, PBXSourceTree.Source); + proj.AddFileToBuild(target, fileGuid); + } + + File.WriteAllText(projPath, proj.WriteToString()); + return true; + } + + private static string GetRelativePath(string absolutePath, string rootPath) { + if (Directory.Exists(rootPath) && !rootPath.EndsWith(Path.AltDirectorySeparatorChar.ToString())) { + rootPath += Path.AltDirectorySeparatorChar; + } + Uri aboslutePathUri = new Uri(absolutePath); + Uri rootPathUri = new Uri(rootPath); + var relateivePath = rootPathUri.MakeRelativeUri(aboslutePathUri).ToString(); + Debug.LogFormat($"[TapCommonCompile] GetRelativePath absolutePath:{absolutePath} rootPath:{rootPath} relateivePath:{relateivePath} "); + return relateivePath; + } + + public static bool HandlerPlist(string pathToBuildProject, string infoPlistPath, bool macos = false) + { +// #if UNITY_2020_1_OR_NEWER +// var macosXCodePlistPath = +// $"{pathToBuildProject}/{PlayerSettings.productName}/Info.plist"; +// #elif UNITY_2019_1_OR_NEWER +// var macosXCodePlistPath = +// $"{Path.GetDirectoryName(pathToBuildProject)}/{PlayerSettings.productName}/Info.plist"; +// #endif + + string plistPath; + + if (pathToBuildProject.EndsWith(".app")) + { + plistPath = $"{pathToBuildProject}/Contents/Info.plist"; + } + else + { + var macosXCodePlistPath = + $"{Path.GetDirectoryName(pathToBuildProject)}/{PlayerSettings.productName}/Info.plist"; + if (!File.Exists(macosXCodePlistPath)) + { + macosXCodePlistPath = $"{pathToBuildProject}/{PlayerSettings.productName}/Info.plist"; + } + + plistPath = !macos + ? pathToBuildProject + "/Info.plist" + : macosXCodePlistPath; + } + + Debug.Log($"plist path:{plistPath}"); + + var plist = new PlistDocument(); + plist.ReadFromString(File.ReadAllText(plistPath)); + var rootDic = plist.root; + + var items = new List + { + "tapsdk", + "tapiosdk", + }; + + if (!(rootDic["LSApplicationQueriesSchemes"] is PlistElementArray plistElementList)) + { + plistElementList = rootDic.CreateArray("LSApplicationQueriesSchemes"); + } + + foreach (var t in items) + { + plistElementList.AddString(t); + } + + if (string.IsNullOrEmpty(infoPlistPath)) return false; + var dic = (Dictionary) Plist.readPlist(infoPlistPath); + var taptapId = ""; + + foreach (var item in dic) + { + if (item.Key.Equals("taptap")) + { + var taptapDic = (Dictionary) item.Value; + foreach (var taptapItem in taptapDic.Where(taptapItem => taptapItem.Key.Equals("client_id"))) + { + taptapId = (string) taptapItem.Value; + } + } + else + { + rootDic.SetString(item.Key, item.Value.ToString()); + } + } + + //添加url + var dict = plist.root.AsDict(); + if (!(dict["CFBundleURLTypes"] is PlistElementArray array)) + { + array = dict.CreateArray("CFBundleURLTypes"); + } + + if (!macos) + { + var dict2 = array.AddDict(); + dict2.SetString("CFBundleURLName", "TapTap"); + var array2 = dict2.CreateArray("CFBundleURLSchemes"); + array2.AddString($"tt{taptapId}"); + } + else + { + var dict2 = array.AddDict(); + dict2.SetString("CFBundleURLName", "TapWeb"); + var array2 = dict2.CreateArray("CFBundleURLSchemes"); + array2.AddString($"open-taptap-{taptapId}"); + } + + Debug.Log("TapSDK change plist Success"); + File.WriteAllText(plistPath, plist.WriteToString()); + return true; + } + + public static string GetValueFromPlist(string infoPlistPath, string key) + { + if (infoPlistPath == null) + { + return null; + } + + var dic = (Dictionary) Plist.readPlist(infoPlistPath); + return (from item in dic where item.Key.Equals(key) select (string) item.Value).FirstOrDefault(); + } +#endif + } +} \ No newline at end of file diff --git a/Editor/TapCommonCompile.cs.meta b/Editor/TapCommonCompile.cs.meta new file mode 100644 index 0000000..77e4114 --- /dev/null +++ b/Editor/TapCommonCompile.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c5475af505e04119831448fe963f9c2c +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/TapCommonIOSProcessor.cs b/Editor/TapCommonIOSProcessor.cs new file mode 100644 index 0000000..56c68b1 --- /dev/null +++ b/Editor/TapCommonIOSProcessor.cs @@ -0,0 +1,74 @@ +using System.IO; +using UnityEditor; +# if UNITY_IOS +using UnityEditor.Callbacks; +using UnityEditor.iOS.Xcode; +#endif +using UnityEngine; + +namespace TapTap.Common.Editor +{ +# if UNITY_IOS + public static class TapCommonIOSProcessor + { + // 添加标签,unity导出工程后自动执行该函数 + [PostProcessBuild(99)] + public static void OnPostprocessBuild(BuildTarget buildTarget, string path) + { + if (buildTarget != BuildTarget.iOS) return; + + // 获得工程路径 + var projPath = TapCommonCompile.GetProjPath(path); + var proj = TapCommonCompile.ParseProjPath(projPath); + var target = TapCommonCompile.GetUnityTarget(proj); + var unityFrameworkTarget = TapCommonCompile.GetUnityFrameworkTarget(proj); + + if (TapCommonCompile.CheckTarget(target)) + { + Debug.LogError("Unity-iPhone is NUll"); + return; + } + + proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC"); + proj.AddBuildProperty(unityFrameworkTarget, "OTHER_LDFLAGS", "-ObjC"); + + proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO"); + proj.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); + proj.SetBuildProperty(target, "SWIFT_VERSION", "5.0"); + proj.SetBuildProperty(target, "CLANG_ENABLE_MODULES", "YES"); + + proj.SetBuildProperty(unityFrameworkTarget, "ENABLE_BITCODE", "NO"); + proj.SetBuildProperty(unityFrameworkTarget, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO"); + proj.SetBuildProperty(unityFrameworkTarget, "SWIFT_VERSION", "5.0"); + proj.SetBuildProperty(unityFrameworkTarget, "CLANG_ENABLE_MODULES", "YES"); + + proj.AddFrameworkToProject(unityFrameworkTarget, "MobileCoreServices.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "WebKit.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "Security.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "CoreTelephony.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false); + + proj.AddFileToBuild(unityFrameworkTarget, + proj.AddFile("usr/lib/libc++.tbd", "libc++.tbd", PBXSourceTree.Sdk)); + + proj.AddFileToBuild(unityFrameworkTarget, + proj.AddFile("usr/lib/libsqlite3.tbd", "libsqlite3.tbd", PBXSourceTree.Sdk)); + + if (TapCommonCompile.HandlerIOSSetting(path, + Application.dataPath, + "TapCommonResource", + "com.taptap.tds.common", + "Common", + new[] {"TapCommonResource.bundle"}, + target, projPath, proj)) + { + Debug.Log("TapCommon add Bundle Success!"); + return; + } + + Debug.LogError("TapCommon add Bundle Failed!"); + } + } +#endif +} \ No newline at end of file diff --git a/Editor/TapCommonIOSProcessor.cs.meta b/Editor/TapCommonIOSProcessor.cs.meta new file mode 100644 index 0000000..7ed37ba --- /dev/null +++ b/Editor/TapCommonIOSProcessor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 28d4870389ed406eac7c8849da60c644 +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/TapFileHelper.cs b/Editor/TapFileHelper.cs new file mode 100644 index 0000000..3612f61 --- /dev/null +++ b/Editor/TapFileHelper.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +namespace TapTap.Common.Editor +{ + public class TapFileHelper : System.IDisposable + { + private string filePath; + + public TapFileHelper(string fPath) + { + filePath = fPath; + if (!System.IO.File.Exists(filePath)) + { + Debug.LogError(filePath + "路径下文件不存在"); + return; + } + } + + public void WriteBelow(string below, string text) + { + StreamReader streamReader = new StreamReader(filePath); + string all = streamReader.ReadToEnd(); + streamReader.Close(); + int beginIndex = all.IndexOf(below, StringComparison.Ordinal); + if (beginIndex == -1) + { + Debug.LogError(filePath + "中没有找到字符串" + below); + return; + } + + int endIndex = all.LastIndexOf("\n", beginIndex + below.Length, StringComparison.Ordinal); + all = all.Substring(0, endIndex) + "\n" + text + "\n" + all.Substring(endIndex); + StreamWriter streamWriter = new StreamWriter(filePath); + streamWriter.Write(all); + streamWriter.Close(); + } + + public void Replace(string below, string newText) + { + StreamReader streamReader = new StreamReader(filePath); + string all = streamReader.ReadToEnd(); + streamReader.Close(); + int beginIndex = all.IndexOf(below, StringComparison.Ordinal); + if (beginIndex == -1) + { + Debug.LogError(filePath + "中没有找到字符串" + below); + return; + } + + all = all.Replace(below, newText); + StreamWriter streamWriter = new StreamWriter(filePath); + streamWriter.Write(all); + streamWriter.Close(); + } + + public void Dispose() + { + } + + public static void CopyAndReplaceDirectory(string srcPath, string dstPath) + { + if (Directory.Exists(dstPath)) + Directory.Delete(dstPath, true); + if (File.Exists(dstPath)) + File.Delete(dstPath); + + Directory.CreateDirectory(dstPath); + + foreach (var file in Directory.GetFiles(srcPath)) + File.Copy(file, Path.Combine(dstPath, Path.GetFileName(file))); + + foreach (var dir in Directory.GetDirectories(srcPath)) + CopyAndReplaceDirectory(dir, Path.Combine(dstPath, Path.GetFileName(dir))); + } + + + public static void DeleteFileBySuffix(string dir, string[] suffix) + { + if (!Directory.Exists(dir)) + { + return; + } + + foreach (var file in Directory.GetFiles(dir)) + { + foreach (var suffixName in suffix) + { + if (file.Contains(suffixName)) + { + File.Delete(file); + } + } + } + } + + public static string FilterFileByPrefix(string srcPath, string filterName) + { + if (!Directory.Exists(srcPath)) + { + return null; + } + + foreach (var dir in Directory.GetDirectories(srcPath)) + { + string fileName = Path.GetFileName(dir); + if (fileName.StartsWith(filterName)) + { + return Path.Combine(srcPath, Path.GetFileName(dir)); + } + } + + return null; + } + + public static string FilterFileBySuffix(string srcPath, string suffix) + { + if (!Directory.Exists(srcPath)) + { + return null; + } + + foreach (var dir in Directory.GetDirectories(srcPath)) + { + string fileName = Path.GetFileName(dir); + if (fileName.StartsWith(suffix)) + { + return Path.Combine(srcPath, Path.GetFileName(dir)); + } + } + + return null; + } + + public static FileInfo RecursionFilterFile(string dir, string fileName) + { + List fileInfoList = new List(); + Director(dir, fileInfoList); + foreach (FileInfo item in fileInfoList) + { + if (fileName.Equals(item.Name)) + { + return item; + } + } + + return null; + } + + public static void Director(string dir, List list) + { + DirectoryInfo d = new DirectoryInfo(dir); + FileInfo[] files = d.GetFiles(); + DirectoryInfo[] directs = d.GetDirectories(); + foreach (FileInfo f in files) + { + list.Add(f); + } + + foreach (DirectoryInfo dd in directs) + { + Director(dd.FullName, list); + } + } + } +} \ No newline at end of file diff --git a/Editor/TapFileHelper.cs.meta b/Editor/TapFileHelper.cs.meta new file mode 100644 index 0000000..4544e0a --- /dev/null +++ b/Editor/TapFileHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d1556fcb81944af6a42170d3e1c99269 +timeCreated: 1617120740 \ No newline at end of file diff --git a/Editor/TapTap.Common.Editor.asmdef b/Editor/TapTap.Common.Editor.asmdef new file mode 100644 index 0000000..ea9b034 --- /dev/null +++ b/Editor/TapTap.Common.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "TapTap.Common.Editor", + "references": [ + "GUID:0b3f64ec33f5b4da98a17367a35b82f2" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/TapTap.Common.Editor.asmdef.meta b/Editor/TapTap.Common.Editor.asmdef.meta new file mode 100644 index 0000000..35eb2db --- /dev/null +++ b/Editor/TapTap.Common.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 616cea76def2d4f059b94440fc8cc03d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/UI.meta b/Editor/UI.meta new file mode 100644 index 0000000..ac23679 --- /dev/null +++ b/Editor/UI.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d7b757cf9569ee1469081df1e8e79931 +folderAsset: yes +timeCreated: 1533042733 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/UI/ScrollViewEditor.cs b/Editor/UI/ScrollViewEditor.cs new file mode 100644 index 0000000..d45ad9a --- /dev/null +++ b/Editor/UI/ScrollViewEditor.cs @@ -0,0 +1,267 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using System.Linq; + using System.Reflection; + using UnityEditor; + using UnityEditor.UI; + using UnityEngine; + using UnityEngine.UI; + + [CustomEditor(typeof(ScrollView))] + public class ScrollViewEditor : ScrollRectEditor + { + private const string bgPath = "UI/Skin/Background.psd"; + private const string spritePath = "UI/Skin/UISprite.psd"; + private const string maskPath = "UI/Skin/UIMask.psd"; + private static Color panelColor = new Color(1f, 1f, 1f, 0.392f); + private static Color defaultSelectableColor = new Color(1f, 1f, 1f, 1f); + private static Vector2 thinElementSize = new Vector2(160f, 20f); + private static Action PlaceUIElementRoot; + + private SerializedProperty itemTemplate; + private SerializedProperty poolSize; + private SerializedProperty defaultItemSize; + private SerializedProperty layoutType; + + private GUIStyle cachedCaption; + + private GUIStyle caption + { + get + { + if (this.cachedCaption == null) + { + this.cachedCaption = new GUIStyle { richText = true, alignment = TextAnchor.MiddleCenter }; + } + + return this.cachedCaption; + } + } + + public override void OnInspectorGUI() + { + this.serializedObject.Update(); + + EditorGUILayout.BeginVertical("box"); + EditorGUILayout.LabelField("Additional configs", this.caption); + EditorGUILayout.Space(); + this.DrawConfigInfo(); + this.serializedObject.ApplyModifiedProperties(); + EditorGUILayout.EndVertical(); + + EditorGUILayout.BeginVertical("box"); + EditorGUILayout.LabelField("For original ScrollRect", this.caption); + EditorGUILayout.Space(); + base.OnInspectorGUI(); + EditorGUILayout.EndVertical(); + } + + protected static void InternalAddScrollView(MenuCommand menuCommand) + where T : ScrollView + { + GetPrivateMethodByReflection(); + + GameObject root = CreateUIElementRoot(typeof(T).Name, new Vector2(200, 200)); + PlaceUIElementRoot?.Invoke(root, menuCommand); + + GameObject viewport = CreateUIObject("Viewport", root); + GameObject content = CreateUIObject("Content", viewport); + + var parent = menuCommand.context as GameObject; + if (parent != null) + { + root.transform.SetParent(parent.transform, false); + } + + Selection.activeGameObject = root; + + GameObject hScrollbar = CreateScrollbar(); + hScrollbar.name = "Scrollbar Horizontal"; + hScrollbar.transform.SetParent(root.transform, false); + RectTransform hScrollbarRT = hScrollbar.GetComponent(); + hScrollbarRT.anchorMin = Vector2.zero; + hScrollbarRT.anchorMax = Vector2.right; + hScrollbarRT.pivot = Vector2.zero; + hScrollbarRT.sizeDelta = new Vector2(0, hScrollbarRT.sizeDelta.y); + + GameObject vScrollbar = CreateScrollbar(); + vScrollbar.name = "Scrollbar Vertical"; + vScrollbar.transform.SetParent(root.transform, false); + vScrollbar.GetComponent().SetDirection(Scrollbar.Direction.BottomToTop, true); + RectTransform vScrollbarRT = vScrollbar.GetComponent(); + vScrollbarRT.anchorMin = Vector2.right; + vScrollbarRT.anchorMax = Vector2.one; + vScrollbarRT.pivot = Vector2.one; + vScrollbarRT.sizeDelta = new Vector2(vScrollbarRT.sizeDelta.x, 0); + + RectTransform viewportRect = viewport.GetComponent(); + viewportRect.anchorMin = Vector2.zero; + viewportRect.anchorMax = Vector2.one; + viewportRect.sizeDelta = Vector2.zero; + viewportRect.pivot = Vector2.up; + + RectTransform contentRect = content.GetComponent(); + contentRect.anchorMin = Vector2.up; + contentRect.anchorMax = Vector2.one; + contentRect.sizeDelta = new Vector2(0, 300); + contentRect.pivot = Vector2.up; + + ScrollView scrollRect = root.AddComponent(); + scrollRect.content = contentRect; + scrollRect.viewport = viewportRect; + scrollRect.horizontalScrollbar = hScrollbar.GetComponent(); + scrollRect.verticalScrollbar = vScrollbar.GetComponent(); + scrollRect.horizontalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport; + scrollRect.verticalScrollbarVisibility = ScrollRect.ScrollbarVisibility.AutoHideAndExpandViewport; + scrollRect.horizontalScrollbarSpacing = -3; + scrollRect.verticalScrollbarSpacing = -3; + + Image rootImage = root.AddComponent(); + rootImage.sprite = AssetDatabase.GetBuiltinExtraResource(bgPath); + rootImage.type = Image.Type.Sliced; + rootImage.color = panelColor; + + Mask viewportMask = viewport.AddComponent(); + viewportMask.showMaskGraphic = false; + + Image viewportImage = viewport.AddComponent(); + viewportImage.sprite = AssetDatabase.GetBuiltinExtraResource(maskPath); + viewportImage.type = Image.Type.Sliced; + } + + protected override void OnEnable() + { + base.OnEnable(); + + this.itemTemplate = this.serializedObject.FindProperty("itemTemplate"); + this.poolSize = this.serializedObject.FindProperty("poolSize"); + this.defaultItemSize = this.serializedObject.FindProperty("defaultItemSize"); + this.layoutType = this.serializedObject.FindProperty("layoutType"); + } + + protected virtual void DrawConfigInfo() + { + EditorGUILayout.PropertyField(this.itemTemplate); + EditorGUILayout.PropertyField(this.poolSize); + EditorGUILayout.PropertyField(this.defaultItemSize); + this.layoutType.intValue = (int)(ScrollView.ItemLayoutType)EditorGUILayout.EnumPopup("layoutType", (ScrollView.ItemLayoutType)this.layoutType.intValue); + } + + [MenuItem("GameObject/UI/DynamicScrollView", false, 90)] + private static void AddScrollView(MenuCommand menuCommand) + { + InternalAddScrollView(menuCommand); + } + + private static GameObject CreateScrollbar() + { + // Create GOs Hierarchy + GameObject scrollbarRoot = CreateUIElementRoot("Scrollbar", thinElementSize); + GameObject sliderArea = CreateUIObject("Sliding Area", scrollbarRoot); + GameObject handle = CreateUIObject("Handle", sliderArea); + + Image bgImage = scrollbarRoot.AddComponent(); + bgImage.sprite = AssetDatabase.GetBuiltinExtraResource(bgPath); + bgImage.type = Image.Type.Sliced; + bgImage.color = defaultSelectableColor; + + Image handleImage = handle.AddComponent(); + handleImage.sprite = AssetDatabase.GetBuiltinExtraResource(spritePath); + handleImage.type = Image.Type.Sliced; + handleImage.color = defaultSelectableColor; + + RectTransform sliderAreaRect = sliderArea.GetComponent(); + sliderAreaRect.sizeDelta = new Vector2(-20, -20); + sliderAreaRect.anchorMin = Vector2.zero; + sliderAreaRect.anchorMax = Vector2.one; + + RectTransform handleRect = handle.GetComponent(); + handleRect.sizeDelta = new Vector2(20, 20); + + Scrollbar scrollbar = scrollbarRoot.AddComponent(); + scrollbar.handleRect = handleRect; + scrollbar.targetGraphic = handleImage; + SetDefaultColorTransitionValues(scrollbar); + + return scrollbarRoot; + } + + private static GameObject CreateUIElementRoot(string name, Vector2 size) + { + var child = new GameObject(name); + RectTransform rectTransform = child.AddComponent(); + rectTransform.sizeDelta = size; + return child; + } + + private static GameObject CreateUIObject(string name, GameObject parent) + { + var go = new GameObject(name); + go.AddComponent(); + SetParentAndAlign(go, parent); + return go; + } + + private static void SetParentAndAlign(GameObject child, GameObject parent) + { + if (parent == null) + { + return; + } + + child.transform.SetParent(parent.transform, false); + SetLayerRecursively(child, parent.layer); + } + + private static void SetLayerRecursively(GameObject go, int layer) + { + go.layer = layer; + Transform t = go.transform; + for (var i = 0; i < t.childCount; i++) + { + SetLayerRecursively(t.GetChild(i).gameObject, layer); + } + } + + private static void SetDefaultColorTransitionValues(Selectable slider) + { + ColorBlock colors = slider.colors; + colors.highlightedColor = new Color(0.882f, 0.882f, 0.882f); + colors.pressedColor = new Color(0.698f, 0.698f, 0.698f); + colors.disabledColor = new Color(0.521f, 0.521f, 0.521f); + } + + private static void GetPrivateMethodByReflection() + { + if (PlaceUIElementRoot == null) + { + Assembly uiEditorAssembly = AppDomain.CurrentDomain.GetAssemblies() + .FirstOrDefault(asm => asm.GetName().Name == "UnityEditor.UI"); + if (uiEditorAssembly != null) + { + Type menuOptionType = uiEditorAssembly.GetType("UnityEditor.UI.MenuOptions"); + if (menuOptionType != null) + { + MethodInfo miPlaceUIElementRoot = menuOptionType.GetMethod( + "PlaceUIElementRoot", + BindingFlags.NonPublic | BindingFlags.Static); + if (miPlaceUIElementRoot != null) + { + PlaceUIElementRoot = Delegate.CreateDelegate( + typeof(Action), + miPlaceUIElementRoot) + as Action; + } + } + } + } + } + } +} diff --git a/Editor/UI/ScrollViewEditor.cs.meta b/Editor/UI/ScrollViewEditor.cs.meta new file mode 100644 index 0000000..f1a8a4a --- /dev/null +++ b/Editor/UI/ScrollViewEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8518bb829bc508049a52f0606b4f43a5 +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/UI/ScrollViewExEditor.cs b/Editor/UI/ScrollViewExEditor.cs new file mode 100644 index 0000000..a7c02f8 --- /dev/null +++ b/Editor/UI/ScrollViewExEditor.cs @@ -0,0 +1,34 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using UnityEditor; + + [CustomEditor(typeof(ScrollViewEx))] + public class ScrollViewExEditor : ScrollViewEditor + { + private SerializedProperty pageSize; + + protected override void OnEnable() + { + base.OnEnable(); + this.pageSize = this.serializedObject.FindProperty("pageSize"); + } + + protected override void DrawConfigInfo() + { + base.DrawConfigInfo(); + EditorGUILayout.PropertyField(this.pageSize); + } + + [MenuItem("GameObject/UI/DynamicScrollViewEx", false, 90)] + private static void AddScrollViewEx(MenuCommand menuCommand) + { + InternalAddScrollView(menuCommand); + } + } +} diff --git a/Editor/UI/ScrollViewExEditor.cs.meta b/Editor/UI/ScrollViewExEditor.cs.meta new file mode 100644 index 0000000..fb49268 --- /dev/null +++ b/Editor/UI/ScrollViewExEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 12cd1055a4162f842842a60918857100 +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/UI/TapTap.UI.Editor.asmdef b/Editor/UI/TapTap.UI.Editor.asmdef new file mode 100644 index 0000000..11cde7e --- /dev/null +++ b/Editor/UI/TapTap.UI.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "TapTap.UI.Editor", + "references": [ + "GUID:0b3f64ec33f5b4da98a17367a35b82f2" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/UI/TapTap.UI.Editor.asmdef.meta b/Editor/UI/TapTap.UI.Editor.asmdef.meta new file mode 100644 index 0000000..5a4d565 --- /dev/null +++ b/Editor/UI/TapTap.UI.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d577628a069ab4cdc87654cc7ac4b6a4 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile.meta b/Mobile.meta new file mode 100644 index 0000000..f47dd2d --- /dev/null +++ b/Mobile.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 64083c9579506486096d4c0d2a2a8932 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Editor.meta b/Mobile/Editor.meta new file mode 100644 index 0000000..a0f656a --- /dev/null +++ b/Mobile/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2d6d99aa661049e6a8c5c365f940e5d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Editor/TapCommonMobileProcessBuild.cs b/Mobile/Editor/TapCommonMobileProcessBuild.cs new file mode 100644 index 0000000..938eb32 --- /dev/null +++ b/Mobile/Editor/TapCommonMobileProcessBuild.cs @@ -0,0 +1,20 @@ +using System; +using UnityEditor.Build.Reporting; +using TapTap.Common.Editor; + +namespace TapTap.Common.Mobile.Editor { + public class TapCommonMobileProcessBuild : SDKLinkProcessBuild { + public override int callbackOrder => 0; + + public override string LinkPath => "TapTap/Common/link.xml"; + + public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] { + new LinkedAssembly { Fullname = "TapTap.Common.Runtime" }, + new LinkedAssembly { Fullname = "TapTap.Common.Mobile.Runtime" } + }; + + public override Func IsTargetPlatform => (report) => { + return BuildTargetUtils.IsSupportMobile(report.summary.platform); + }; + } +} diff --git a/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta b/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta new file mode 100644 index 0000000..5b4a6d8 --- /dev/null +++ b/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f0b99f7553794a8791cee0ebb2c953a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Editor/TapTap.Common.Mobile.Editor.asmdef b/Mobile/Editor/TapTap.Common.Mobile.Editor.asmdef new file mode 100644 index 0000000..8f44cd5 --- /dev/null +++ b/Mobile/Editor/TapTap.Common.Mobile.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "TapTap.Common.Mobile.Editor", + "references": [ + "GUID:616cea76def2d4f059b94440fc8cc03d" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Mobile/Editor/TapTap.Common.Mobile.Editor.asmdef.meta b/Mobile/Editor/TapTap.Common.Mobile.Editor.asmdef.meta new file mode 100644 index 0000000..8f81925 --- /dev/null +++ b/Mobile/Editor/TapTap.Common.Mobile.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 747e53b1749584bae9386571797e5eb5 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Plugins.meta b/Mobile/Plugins.meta new file mode 100644 index 0000000..8d21012 --- /dev/null +++ b/Mobile/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23fedb802d153432e9b7e8e2dca2d3f4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Plugins/Android.meta b/Mobile/Plugins/Android.meta new file mode 100644 index 0000000..ea6105b --- /dev/null +++ b/Mobile/Plugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d613cbf7e66b4849b75f0c17665043d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Plugins/Android/arm64-v8a.meta b/Mobile/Plugins/Android/arm64-v8a.meta new file mode 100644 index 0000000..fc4e2d5 --- /dev/null +++ b/Mobile/Plugins/Android/arm64-v8a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7665fa69688034f88b96e3926a190a78 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Plugins/Android/arm64-v8a/libbindings-csharp.so b/Mobile/Plugins/Android/arm64-v8a/libbindings-csharp.so new file mode 100644 index 0000000..5b31906 Binary files /dev/null and b/Mobile/Plugins/Android/arm64-v8a/libbindings-csharp.so differ diff --git a/Mobile/Plugins/Android/arm64-v8a/libbindings-csharp.so.meta b/Mobile/Plugins/Android/arm64-v8a/libbindings-csharp.so.meta new file mode 100644 index 0000000..0874712 --- /dev/null +++ b/Mobile/Plugins/Android/arm64-v8a/libbindings-csharp.so.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: e01d04d4b428e45508e87e973497dbe5 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARM64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Plugins/Android/armeabi-v7a.meta b/Mobile/Plugins/Android/armeabi-v7a.meta new file mode 100644 index 0000000..1c9ff1e --- /dev/null +++ b/Mobile/Plugins/Android/armeabi-v7a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0fa75c5d7ce549c08ab2fb6353034b8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Plugins/Android/armeabi-v7a/libbindings-csharp.so b/Mobile/Plugins/Android/armeabi-v7a/libbindings-csharp.so new file mode 100644 index 0000000..0518437 Binary files /dev/null and b/Mobile/Plugins/Android/armeabi-v7a/libbindings-csharp.so differ diff --git a/Mobile/Plugins/Android/armeabi-v7a/libbindings-csharp.so.meta b/Mobile/Plugins/Android/armeabi-v7a/libbindings-csharp.so.meta new file mode 100644 index 0000000..2af3c1e --- /dev/null +++ b/Mobile/Plugins/Android/armeabi-v7a/libbindings-csharp.so.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 495d1cc3f857842969280c751449b7b9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime.meta b/Mobile/Runtime.meta new file mode 100644 index 0000000..7962ce1 --- /dev/null +++ b/Mobile/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8357dd3b84a964d1595e1977d6d63177 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/Bridge.cs b/Mobile/Runtime/Bridge.cs new file mode 100644 index 0000000..391d54b --- /dev/null +++ b/Mobile/Runtime/Bridge.cs @@ -0,0 +1,79 @@ +using System; +using System.Threading.Tasks; + +namespace TapTap.Common +{ + public class EngineBridge + { + private static volatile EngineBridge _sInstance; + + private readonly IBridge _bridge; + + private static readonly object Locker = new object(); + + public static EngineBridge GetInstance() + { + lock (Locker) + { + if (_sInstance == null) + { + _sInstance = new EngineBridge(); + } + } + + return _sInstance; + } + + private EngineBridge() + { + if (Platform.IsAndroid()) + { + _bridge = BridgeAndroid.GetInstance(); + } + else if (Platform.IsIOS()) + { + _bridge = BridgeIOS.GetInstance(); + } + } + + public void Register(string serviceClzName, string serviceImplName) + { + _bridge?.Register(serviceClzName, serviceImplName); + } + + public void CallHandler(Command command) + { + _bridge?.Call(command); + } + + public void CallHandler(Command command, Action action) + { + _bridge?.Call(command, action); + } + + public Task Emit(Command command) + { + var tcs = new TaskCompletionSource(); + CallHandler(command, result => + { + tcs.TrySetResult(result); + }); + return tcs.Task; + } + + public static bool CheckResult(Result result) + { + if (result == null) + { + return false; + } + + if (result.code != Result.RESULT_SUCCESS) + { + return false; + } + + return !string.IsNullOrEmpty(result.content); + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/Bridge.cs.meta b/Mobile/Runtime/Bridge.cs.meta new file mode 100644 index 0000000..fca1aa1 --- /dev/null +++ b/Mobile/Runtime/Bridge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a59ea35d6e5c450194ab8bd34973ae7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/BridgeAndroid.cs b/Mobile/Runtime/BridgeAndroid.cs new file mode 100644 index 0000000..51c2638 --- /dev/null +++ b/Mobile/Runtime/BridgeAndroid.cs @@ -0,0 +1,67 @@ +using System; +using UnityEngine; + +namespace TapTap.Common +{ + public class BridgeAndroid : IBridge + { + private string bridgeJavaClz = "com.tds.common.bridge.Bridge"; + + private string instanceMethod = "getInstance"; + + private string registerHandlerMethod = "registerHandler"; + + private string callHandlerMethod = "callHandler"; + + private string initMethod = "init"; + + private string registerMethod = "register"; + + private readonly AndroidJavaObject _mAndroidBridge; + + private static readonly BridgeAndroid SInstance = new BridgeAndroid(); + + public static BridgeAndroid GetInstance() + { + return SInstance; + } + + private BridgeAndroid() + { + var mCurrentActivity = + new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"); + _mAndroidBridge = new AndroidJavaClass(bridgeJavaClz).CallStatic(instanceMethod); + _mAndroidBridge.Call(initMethod, mCurrentActivity); + } + + public void Register(string serviceClzName, string serviceImplName) + { + if (_mAndroidBridge == null) + { + return; + } + + try + { + var serviceClass = new AndroidJavaClass(serviceClzName); + var serviceImpl = new AndroidJavaObject(serviceImplName); + _mAndroidBridge.Call(registerMethod, serviceClass, serviceImpl); + } + catch (Exception e) + { + Debug.Log("register Failed:" + e); + // + } + } + + public void Call(Command command, Action action) + { + _mAndroidBridge?.Call(registerHandlerMethod, command.ToJSON(), new BridgeCallback(action)); + } + + public void Call(Command command) + { + _mAndroidBridge?.Call(callHandlerMethod, command.ToJSON()); + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/BridgeAndroid.cs.meta b/Mobile/Runtime/BridgeAndroid.cs.meta new file mode 100644 index 0000000..b707543 --- /dev/null +++ b/Mobile/Runtime/BridgeAndroid.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a30539bf2c5c4b9e891293fc7bd563b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/BridgeCallback.cs b/Mobile/Runtime/BridgeCallback.cs new file mode 100644 index 0000000..987eb89 --- /dev/null +++ b/Mobile/Runtime/BridgeCallback.cs @@ -0,0 +1,33 @@ +using System; +using UnityEngine; + +namespace TapTap.Common +{ + + public class BridgeCallback : AndroidJavaProxy + { + Action callback; + + public BridgeCallback(Action action) : + base(new AndroidJavaClass("com.tds.common.bridge.BridgeCallback")) + { + this.callback = action; + } + + public override AndroidJavaObject Invoke(string method, object[] args) + { + if (method.Equals("onResult")) + { + if (args[0] is string) + { + string result = (string)(args[0]); + callback(new Result(result)); + } + } + return null; + } + + } + + +} \ No newline at end of file diff --git a/Mobile/Runtime/BridgeCallback.cs.meta b/Mobile/Runtime/BridgeCallback.cs.meta new file mode 100644 index 0000000..ef07a64 --- /dev/null +++ b/Mobile/Runtime/BridgeCallback.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c7e2835d962a4a4997c93212b4a1171 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/BridgeIOS.cs b/Mobile/Runtime/BridgeIOS.cs new file mode 100644 index 0000000..f6d7a19 --- /dev/null +++ b/Mobile/Runtime/BridgeIOS.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Concurrent; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace TapTap.Common +{ + public class BridgeIOS : IBridge + { + private static readonly BridgeIOS SInstance = new BridgeIOS(); + + private readonly ConcurrentDictionary> dic; + + public static BridgeIOS GetInstance() + { + return SInstance; + } + + private BridgeIOS() + { + dic = new ConcurrentDictionary>(); + } + + private ConcurrentDictionary> GetConcurrentDictionary() + { + return dic; + } + + private delegate void EngineBridgeDelegate(string result); + + [AOT.MonoPInvokeCallbackAttribute(typeof(EngineBridgeDelegate))] + static void engineBridgeDelegate(string resultJson) + { + var result = new Result(resultJson); + + var actionDic = GetInstance().GetConcurrentDictionary(); + + Action action = null; + + if (actionDic != null && actionDic.ContainsKey(result.callbackId)) + { + action = actionDic[result.callbackId]; + } + + if (action != null) + { + action(result); + if (result.onceTime && BridgeIOS.GetInstance().GetConcurrentDictionary() + .TryRemove(result.callbackId, out Action outAction)) + { + Debug.Log($"TapSDK resolved current Action:{result.callbackId}"); + } + } + + Debug.Log($"TapSDK iOS BridgeAction last Count:{BridgeIOS.GetInstance().GetConcurrentDictionary().Count}"); + } + + + + public void Register(string serviceClz, string serviceImp) + { + //IOS无需注册 + } + + public void Call(Command command) + { +#if UNITY_IOS + callHandler(command.ToJSON()); +#endif + } + + public void Call(Command command, Action action) + { + if (!command.callback || string.IsNullOrEmpty(command.callbackId)) return; + if (!dic.ContainsKey(command.callbackId)) + { + dic.GetOrAdd(command.callbackId, action); + } +#if UNITY_IOS + registerHandler(command.ToJSON(), engineBridgeDelegate); +#endif + } +#if UNITY_IOS + [DllImport("__Internal")] + private static extern void callHandler(string command); + + [DllImport("__Internal")] + private static extern void registerHandler(string command, EngineBridgeDelegate engineBridgeDelegate); +#endif + } +} \ No newline at end of file diff --git a/Mobile/Runtime/BridgeIOS.cs.meta b/Mobile/Runtime/BridgeIOS.cs.meta new file mode 100644 index 0000000..485bdbb --- /dev/null +++ b/Mobile/Runtime/BridgeIOS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5a68a7cfba514945b6fba56b7086ea8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/Command.cs b/Mobile/Runtime/Command.cs new file mode 100644 index 0000000..56d4e30 --- /dev/null +++ b/Mobile/Runtime/Command.cs @@ -0,0 +1,119 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace TapTap.Common +{ + public class Command + { + [SerializeField] public string service; + [SerializeField] public string method; + [SerializeField] public string args; + [SerializeField] public bool callback; + [SerializeField] public string callbackId; + [SerializeField] public bool onceTime; + + public Command() + { + + } + + public Command(string json) + { + JsonUtility.FromJsonOverwrite(json, this); + } + + public string ToJSON() + { + return JsonUtility.ToJson(this); + } + + public Command(string service, string method, bool callback, Dictionary dic) + { + this.args = dic == null ? null : Json.Serialize(dic); + this.service = service; + this.method = method; + this.callback = callback; + this.callbackId = this.callback ? TapUUID.UUID() : null; + } + + public Command(string service, string method, bool callback, bool onceTime, Dictionary dic) + { + this.args = dic == null ? null : Json.Serialize(dic); + this.service = service; + this.method = method; + this.callback = callback; + this.callbackId = this.callback ? TapUUID.UUID() : null; + this.onceTime = onceTime; + } + + public class Builder + { + private string service; + + private string method; + + private bool callback; + + private string callbackId; + + private bool onceTime; + + private Dictionary args; + + public Builder() + { + + } + + public Builder Service(string service) + { + this.service = service; + return this; + } + + public Builder Method(string method) + { + this.method = method; + return this; + } + + public Builder OnceTime(bool onceTime) + { + this.onceTime = onceTime; + return this; + } + + public Builder Args(Dictionary dic) + { + this.args = dic; + return this; + } + + public Builder Args(string key, object value) + { + if (this.args == null) + { + this.args = new Dictionary(); + } + if(value is Dictionary) + { + value = Json.Serialize(value); + } + this.args.Add(key, value); + return this; + } + + public Builder Callback(bool callback) + { + this.callback = callback; + this.callbackId = this.callback ? TapUUID.UUID() : null; + return this; + } + + public Command CommandBuilder() + { + return new Command(this.service, this.method, this.callback, this.onceTime, this.args); + } + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/Command.cs.meta b/Mobile/Runtime/Command.cs.meta new file mode 100644 index 0000000..16116ba --- /dev/null +++ b/Mobile/Runtime/Command.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1270e5e2ef8de406c877f8c7b0ba8bca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/Constants.cs b/Mobile/Runtime/Constants.cs new file mode 100644 index 0000000..e564880 --- /dev/null +++ b/Mobile/Runtime/Constants.cs @@ -0,0 +1,9 @@ +namespace TapTap.Common +{ + public static class Constants + { + public const string VersionKey = "Engine-Version"; + + public const string PlatformKey = "Engine-Platform"; + } +} \ No newline at end of file diff --git a/Mobile/Runtime/Constants.cs.meta b/Mobile/Runtime/Constants.cs.meta new file mode 100644 index 0000000..60da319 --- /dev/null +++ b/Mobile/Runtime/Constants.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89331e94880b1436bb7c6286193d6e1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/IBridge.cs b/Mobile/Runtime/IBridge.cs new file mode 100644 index 0000000..c998acd --- /dev/null +++ b/Mobile/Runtime/IBridge.cs @@ -0,0 +1,14 @@ +using System; + +namespace TapTap.Common +{ + public interface IBridge + { + void Register(string serviceClzName, string serviceImplName); + + void Call(Command command); + + void Call(Command command, Action action); + + } +} \ No newline at end of file diff --git a/Mobile/Runtime/IBridge.cs.meta b/Mobile/Runtime/IBridge.cs.meta new file mode 100644 index 0000000..332cc39 --- /dev/null +++ b/Mobile/Runtime/IBridge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 772dceb95dc5a432a8ac9f9152693bde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/ITapCommon.cs b/Mobile/Runtime/ITapCommon.cs new file mode 100644 index 0000000..e64e729 --- /dev/null +++ b/Mobile/Runtime/ITapCommon.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace TapTap.Common +{ + public interface ITapCommon + { + void Init(TapConfig config); + + void GetRegionCode(Action callback); + + void IsTapTapInstalled(Action callback); + + void IsTapTapGlobalInstalled(Action callback); + + void UpdateGameInTapTap(string appId, Action callback); + + void UpdateGameInTapGlobal(string appId, Action callback); + + void OpenReviewInTapTap(string appId, Action callback); + + void OpenReviewInTapGlobal(string appId, Action callback); + + void SetLanguage(TapLanguage language); + + void SetXua(); + + void RegisterProperties(string key, ITapPropertiesProxy proxy); + + void UseNativeDataInCore(bool enable); + void SetDurationStatisticsEnabled(bool enable); + + void AddHost(string host, string replaceHost); + + Task UpdateGameAndFailToWebInTapTap(string appId); + + Task UpdateGameAndFailToWebInTapGlobal(string appId); + + Task UpdateGameAndFailToWebInTapTap(string appId, string webUrl); + + Task UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl); + + Task OpenWebDownloadUrlOfTapTap(string appId); + + Task OpenWebDownloadUrlOfTapGlobal(string appId); + + Task OpenWebDownloadUrl(string url); + } + + [Serializable] + public class CommonRegionWrapper + { + public bool isMainland; + + public CommonRegionWrapper(string json) + { + Dictionary dic = Json.Deserialize(json) as Dictionary; + isMainland = SafeDictionary.GetValue(dic, "isMainland"); + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/ITapCommon.cs.meta b/Mobile/Runtime/ITapCommon.cs.meta new file mode 100644 index 0000000..1f84a87 --- /dev/null +++ b/Mobile/Runtime/ITapCommon.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fce5579d1046b41d998725853e4acecb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/Result.cs b/Mobile/Runtime/Result.cs new file mode 100644 index 0000000..eddd129 --- /dev/null +++ b/Mobile/Runtime/Result.cs @@ -0,0 +1,37 @@ +using System; +using UnityEngine; + +namespace TapTap.Common +{ + [Serializable] + public class Result + { + public static int RESULT_SUCCESS = 0; + + public static int RESULT_ERROR = -1; + + [SerializeField] public int code; + + [SerializeField] public string message; + + [SerializeField] public string content; + + [SerializeField] public string callbackId; + + [SerializeField] public bool onceTime; + + public Result() + { + } + + public Result(string json) + { + JsonUtility.FromJsonOverwrite(json, this); + } + + public string ToJSON() + { + return JsonUtility.ToJson(this); + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/Result.cs.meta b/Mobile/Runtime/Result.cs.meta new file mode 100644 index 0000000..5efe964 --- /dev/null +++ b/Mobile/Runtime/Result.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02e98ca9db68c4e439977af38833877d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/TapCommonImpl.cs b/Mobile/Runtime/TapCommonImpl.cs new file mode 100644 index 0000000..adaa2ff --- /dev/null +++ b/Mobile/Runtime/TapCommonImpl.cs @@ -0,0 +1,535 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using UnityEngine; +using LC.Newtonsoft.Json; +using TapTap.Common.Internal.Http; + +namespace TapTap.Common +{ + public class TapCommonImpl : ITapCommon + { + private static readonly string TAP_COMMON_SERVICE = "TDSCommonService"; + + private readonly AndroidJavaObject _proxyServiceImpl; + + private readonly ConcurrentDictionary _propertiesProxies; + + public TapHttpClient HttpClient { + get; private set; + } + + private TapCommonImpl() + { + EngineBridge.GetInstance().Register("com.tds.common.wrapper.TDSCommonService", + "com.tds.common.wrapper.TDSCommonServiceImpl"); + + _proxyServiceImpl = new AndroidJavaObject("com.tds.common.wrapper.TDSCommonServiceImpl"); + + _propertiesProxies = new ConcurrentDictionary(); + } + + private static volatile TapCommonImpl _sInstance; + + private static readonly object Locker = new object(); + + public static TapCommonImpl GetInstance() + { + lock (Locker) + { + if (_sInstance == null) + { + _sInstance = new TapCommonImpl(); + } + } + + return _sInstance; + } + + public void Init(TapConfig config) + { + var commandBuilder = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("initWithConfig") + .Args("initWithConfig", JsonConvert.SerializeObject(config.ToDict())) + .Args("versionName", Assembly.GetExecutingAssembly().GetName().Version.ToString()); + + var command = commandBuilder.CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command); + + HttpClient = new TapHttpClient(config.ClientID, config.ClientToken, config.ServerURL); + } + + public void SetXua() + { + try + { + var xua = new Dictionary + { + {Constants.VersionKey, Assembly.GetExecutingAssembly().GetName().Version.ToString()}, + {Constants.PlatformKey, "Unity"} + }; + + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("setXUA") + .Args("setXUA", Json.Serialize(xua)).CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command); + } + catch (Exception e) + { + Debug.Log($"exception:{e}"); + } + } + + public void GetRegionCode(Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("getRegionCode").Callback(true) + .OnceTime(true) + .CommandBuilder(); + EngineBridge.GetInstance().CallHandler(command, (result) => + { + if (result.code != Result.RESULT_SUCCESS) + { + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + return; + } + + var wrapper = new CommonRegionWrapper(result.content); + callback(wrapper.isMainland); + }); + } + + public void IsTapTapInstalled(Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("isTapTapInstalled") + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command, (result) => + { + if (result.code != Result.RESULT_SUCCESS) + { + callback(false); + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + callback(false); + return; + } + + var dlc = Json.Deserialize(result.content) as Dictionary; + callback(SafeDictionary.GetValue(dlc, "isTapTapInstalled")); + }); + } + + public void IsTapTapGlobalInstalled(Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("isTapGlobalInstalled") + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command, (result) => + { + if (result.code != Result.RESULT_SUCCESS) + { + callback(false); + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + callback(false); + return; + } + + var dlc = Json.Deserialize(result.content) as Dictionary; + callback(SafeDictionary.GetValue(dlc, "isTapGlobalInstalled")); + }); + } + + public void UpdateGameInTapTap(string appId, Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("updateGameInTapTap") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command, (result) => + { + if (result.code != Result.RESULT_SUCCESS) + { + callback(false); + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + callback(false); + return; + } + + var dlc = Json.Deserialize(result.content) as Dictionary; + callback(SafeDictionary.GetValue(dlc, "updateGameInTapTap")); + }); + } + + public void UpdateGameInTapGlobal(string appId, Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("updateGameInTapGlobal") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command, result => + { + if (result.code != Result.RESULT_SUCCESS) + { + callback(false); + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + callback(false); + return; + } + + var dlc = Json.Deserialize(result.content) as Dictionary; + callback(SafeDictionary.GetValue(dlc, "updateGameInTapGlobal")); + }); + } + + public void OpenReviewInTapTap(string appId, Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("openReviewInTapTap") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command, result => + { + if (result.code != Result.RESULT_SUCCESS) + { + callback(false); + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + callback(false); + return; + } + + var dlc = Json.Deserialize(result.content) as Dictionary; + callback(SafeDictionary.GetValue(dlc, "openReviewInTapTap")); + }); + } + + public void OpenReviewInTapGlobal(string appId, Action callback) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("openReviewInTapGlobal") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command, result => + { + if (result.code != Result.RESULT_SUCCESS) + { + callback(false); + return; + } + + if (string.IsNullOrEmpty(result.content)) + { + callback(false); + return; + } + + var dlc = Json.Deserialize(result.content) as Dictionary; + callback(SafeDictionary.GetValue(dlc, "openReviewInTapGlobal")); + }); + } + + public void SetLanguage(TapLanguage language) + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("setPreferredLanguage") + .Args("preferredLanguage", (int) language) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command); + } + + + public void RegisterProperties(string key, ITapPropertiesProxy proxy) + { + if (Platform.IsAndroid()) + { + _proxyServiceImpl?.Call("registerProperties", key, new TapPropertiesProxy(proxy)); + } + else if (Platform.IsIOS()) + { +#if UNITY_IOS + if (_propertiesProxies.TryAdd(key, proxy)) + { + Debug.Log($"register Properties:{Json.Serialize(_propertiesProxies)}"); + registerProperties(key, TapPropertiesDelegateProxy); + } +#endif + } + + Debug.Log($"registerProperty:{key == null} value:{proxy == null}"); + } + public void UseNativeDataInCore(bool enable) + { + try + { + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("useNativeDataInCore") + .Args("useNativeDataInCore", enable) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command); + + command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("setDurationStatisticsEnabled") + .Args("setDurationStatisticsEnabled", enable) + .OnceTime(true) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command); + } + catch (System.Exception e) + { + Debug.LogErrorFormat("useNativeDataInCore & setDurationStatisticsEnabled error:{0}\n{1}", e.Message, e.StackTrace); + } + } + + public void SetDurationStatisticsEnabled(bool enable) + { + Debug.Log($"SetDurationStatisticsEnabled:{enable}"); + TapTap.Common.TapCommon.DisableDurationStatistics = !enable; + } + +#if UNITY_IOS + private delegate string TapPropertiesDelegate(string key); + + [AOT.MonoPInvokeCallbackAttribute(typeof(TapPropertiesDelegate))] + private static string TapPropertiesDelegateProxy(string key) + { + Debug.Log($"key:{key} register Properties:{Json.Serialize(_sInstance._propertiesProxies)}"); + var proxy = _sInstance._propertiesProxies[key]; + return proxy?.GetProperties(); + } + + [DllImport("__Internal")] + private static extern void registerProperties(string key, TapPropertiesDelegate propertiesDelegate); +#endif + + + public void AddHost(string host, string replaceHost) + { + Debug.LogFormat($"addHost host:{host} replaceHost:{replaceHost}"); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("addReplacedHostPair") + .Args("hostToBeReplaced", host) + .Args("replacedHost", replaceHost) + .CommandBuilder(); + + EngineBridge.GetInstance().CallHandler(command); + } + + private static void CheckPlatformSupport() + { + if (Platform.IsIOS()) + { + throw new TapException(-1, "iOS Platform dont support current func"); + } + } + + private static void CheckResult(Result result) + { + if (!EngineBridge.CheckResult(result)) + { + throw new TapException(-1, $"TapBridge dont support this Command:{result.message}"); + } + } + + public async Task UpdateGameAndFailToWebInTapTap(string appId) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("updateGameAndFailToWebInTapTap") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + public async Task UpdateGameAndFailToWebInTapGlobal(string appId) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("updateGameAndFailToWebInTapGlobal") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + public async Task UpdateGameAndFailToWebInTapTap(string appId, string webUrl) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("updateGameAndFailToWebInTapTapWithWebUrl") + .Args("appId", appId) + .Args("webUrl", webUrl) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + public async Task UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("updateGameAndFailToWebInTapGlobalWithWebUrl") + .Args("appId", appId) + .Args("webUrl", webUrl) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + public async Task OpenWebDownloadUrlOfTapTap(string appId) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("openWebDownloadUrlOfTapTap") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + public async Task OpenWebDownloadUrlOfTapGlobal(string appId) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("openWebDownloadUrlOfTapGlobal") + .Args("appId", appId) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + public async Task OpenWebDownloadUrl(string url) + { + CheckPlatformSupport(); + var command = new Command.Builder() + .Service(TAP_COMMON_SERVICE) + .Method("openWebDownloadUrl") + .Args("appId", url) + .Callback(true) + .OnceTime(true) + .CommandBuilder(); + + var result = await EngineBridge.GetInstance().Emit(command); + CheckResult(result); + var dic = Json.Deserialize(result.content) as Dictionary; + return SafeDictionary.GetValue(dic, "result"); + } + + private class TapPropertiesProxy : AndroidJavaProxy + { + private readonly ITapPropertiesProxy _properties; + + public TapPropertiesProxy(ITapPropertiesProxy properties) : + base(new AndroidJavaClass("com.tds.common.wrapper.TapPropertiesProxy")) + { + _properties = properties; + } + + public override AndroidJavaObject Invoke(string methodName, object[] args) + { + return _properties != null + ? new AndroidJavaObject("java.lang.String", _properties.GetProperties()) + : base.Invoke(methodName, args); + } + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/TapCommonImpl.cs.meta b/Mobile/Runtime/TapCommonImpl.cs.meta new file mode 100644 index 0000000..0a1d659 --- /dev/null +++ b/Mobile/Runtime/TapCommonImpl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d8e2920a836a48d59ea5221ded9af59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/TapCommonMobile.cs b/Mobile/Runtime/TapCommonMobile.cs new file mode 100644 index 0000000..a098f33 --- /dev/null +++ b/Mobile/Runtime/TapCommonMobile.cs @@ -0,0 +1,115 @@ +using System; +using System.Threading.Tasks; +using TapTap.Common.Internal; + +namespace TapTap.Common.Mobile +{ + public class TapCommonMobile : ITapCommonPlatform + { + public void Init(TapConfig config) + { + TapCommon.UseNativeDataInCore(false); + TapCommonImpl.GetInstance().Init(config); + } + + public void GetRegionCode(Action callback) + { + TapCommonImpl.GetInstance().GetRegionCode(callback); + } + + public void IsTapTapInstalled(Action callback) + { + TapCommonImpl.GetInstance().IsTapTapInstalled(callback); + } + + public void IsTapTapGlobalInstalled(Action callback) + { + TapCommonImpl.GetInstance().IsTapTapGlobalInstalled(callback); + } + + public void UpdateGameInTapTap(string appId, Action callback) + { + TapCommonImpl.GetInstance().UpdateGameInTapTap(appId, callback); + } + + public void UpdateGameInTapGlobal(string appId, Action callback) + { + TapCommonImpl.GetInstance().UpdateGameInTapGlobal(appId, callback); + } + + public void OpenReviewInTapTap(string appId, Action callback) + { + TapCommonImpl.GetInstance().OpenReviewInTapTap(appId, callback); + } + + public void OpenReviewInTapGlobal(string appId, Action callback) + { + TapCommonImpl.GetInstance().OpenReviewInTapGlobal(appId, callback); + } + + public void SetXua() + { + TapCommonImpl.GetInstance().SetXua(); + } + + public void SetLanguage(TapLanguage language) + { + TapCommonImpl.GetInstance().SetLanguage(language); + } + + public void RegisterProperties(string key, ITapPropertiesProxy proxy) + { + TapCommonImpl.GetInstance().RegisterProperties(key, proxy); + } + + public void UseNativeDataInCore(bool enable) + { + TapCommonImpl.GetInstance().UseNativeDataInCore(enable); + } + + public void SetDurationStatisticsEnabled(bool enable) + { + TapCommonImpl.GetInstance().SetDurationStatisticsEnabled(enable); + } + + public void AddHost(string host, string replaceHost) + { + TapCommonImpl.GetInstance().AddHost(host, replaceHost); + } + + public Task UpdateGameAndFailToWebInTapTap(string appId) + { + return TapCommonImpl.GetInstance().UpdateGameAndFailToWebInTapTap(appId); + } + + public Task UpdateGameAndFailToWebInTapGlobal(string appId) + { + return TapCommonImpl.GetInstance().UpdateGameAndFailToWebInTapGlobal(appId); + } + + public Task UpdateGameAndFailToWebInTapTap(string appId, string webUrl) + { + return TapCommonImpl.GetInstance().UpdateGameAndFailToWebInTapTap(appId, webUrl); + } + + public Task UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl) + { + return TapCommonImpl.GetInstance().UpdateGameAndFailToWebInTapGlobal(appId, webUrl); + } + + public Task OpenWebDownloadUrlOfTapTap(string appId) + { + return TapCommonImpl.GetInstance().OpenWebDownloadUrlOfTapTap(appId); + } + + public Task OpenWebDownloadUrlOfTapGlobal(string appId) + { + return TapCommonImpl.GetInstance().OpenWebDownloadUrlOfTapGlobal(appId); + } + + public Task OpenWebDownloadUrl(string url) + { + return TapCommonImpl.GetInstance().OpenWebDownloadUrl(url); + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/TapCommonMobile.cs.meta b/Mobile/Runtime/TapCommonMobile.cs.meta new file mode 100644 index 0000000..00e1d98 --- /dev/null +++ b/Mobile/Runtime/TapCommonMobile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b2a0081fb3044394b8a026d786e4024 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/TapTap.Common.Mobile.Runtime.asmdef b/Mobile/Runtime/TapTap.Common.Mobile.Runtime.asmdef new file mode 100644 index 0000000..5949e43 --- /dev/null +++ b/Mobile/Runtime/TapTap.Common.Mobile.Runtime.asmdef @@ -0,0 +1,18 @@ +{ + "name": "TapTap.Common.Mobile.Runtime", + "references": [ + "GUID:0b3f64ec33f5b4da98a17367a35b82f2" + ], + "includePlatforms": [ + "Android", + "iOS" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Mobile/Runtime/TapTap.Common.Mobile.Runtime.asmdef.meta b/Mobile/Runtime/TapTap.Common.Mobile.Runtime.asmdef.meta new file mode 100644 index 0000000..19c859a --- /dev/null +++ b/Mobile/Runtime/TapTap.Common.Mobile.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 43c632eee0a6f42cdaf21080b154f3a1 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mobile/Runtime/TapUUID.cs b/Mobile/Runtime/TapUUID.cs new file mode 100644 index 0000000..8896890 --- /dev/null +++ b/Mobile/Runtime/TapUUID.cs @@ -0,0 +1,9 @@ +namespace TapTap.Common +{ + public class TapUUID + { + public static string UUID(){ + return System.Guid.NewGuid().ToString(); + } + } +} \ No newline at end of file diff --git a/Mobile/Runtime/TapUUID.cs.meta b/Mobile/Runtime/TapUUID.cs.meta new file mode 100644 index 0000000..bb78d47 --- /dev/null +++ b/Mobile/Runtime/TapUUID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f6eea7b0d0fc4a05b8681af19423c6e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins.meta b/Plugins.meta new file mode 100644 index 0000000..4643bb3 --- /dev/null +++ b/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72ddac62e7598413680ccc6ef4858979 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Android.meta b/Plugins/Android.meta new file mode 100644 index 0000000..1ef290c --- /dev/null +++ b/Plugins/Android.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c40d795a083b457fa3d923415533822c +timeCreated: 1616744098 \ No newline at end of file diff --git a/Plugins/Android/libs.meta b/Plugins/Android/libs.meta new file mode 100644 index 0000000..c2589e0 --- /dev/null +++ b/Plugins/Android/libs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9c15be9bece843a4b6998999a603f389 +timeCreated: 1616744107 \ No newline at end of file diff --git a/Plugins/Android/libs/TapCommon_3.23.0.aar b/Plugins/Android/libs/TapCommon_3.23.0.aar new file mode 100644 index 0000000..ad8f54f Binary files /dev/null and b/Plugins/Android/libs/TapCommon_3.23.0.aar differ diff --git a/Plugins/Android/libs/TapCommon_3.23.0.aar.meta b/Plugins/Android/libs/TapCommon_3.23.0.aar.meta new file mode 100644 index 0000000..c2d97cf --- /dev/null +++ b/Plugins/Android/libs/TapCommon_3.23.0.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 4b282144b6bf34b648a1f3f1242111bb +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS.meta b/Plugins/MacOS.meta new file mode 100644 index 0000000..143fc41 --- /dev/null +++ b/Plugins/MacOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 73b3691a973514db19fd1e16fe5a6ba4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework.meta b/Plugins/MacOS/tds_core.framework.meta new file mode 100644 index 0000000..3f36e49 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework.meta @@ -0,0 +1,81 @@ +fileFormatVersion: 2 +guid: e71a490d240664c03ac26831af61700d +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: OSX + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Headers.meta b/Plugins/MacOS/tds_core.framework/Headers.meta new file mode 100644 index 0000000..316ae07 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Headers.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +<<<<<<<< HEAD:Assets/TapTap/Common/Plugins/MacOS/tds_core.framework/Headers.meta +guid: 8371d753a0e4c4befb31d4f190bb6ce4 +======== +guid: 28c5ee5fa1ba94d9a8343d3614d34cef +>>>>>>>> feat/xd-tap-login:Assets/TapTap/Common/Plugins/MacOS/tds_core.framework/Resources.meta +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Headers/platform.h b/Plugins/MacOS/tds_core.framework/Headers/platform.h new file mode 100644 index 0000000..dfb4e2a --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Headers/platform.h @@ -0,0 +1,43 @@ +// +// Created by 甘尧 on 2023/7/7. +// +#pragma once + +#include +#include +#include + +namespace tapsdk::platform { + +enum class DeviceType { + Local, + Sandbox, + Cloud +}; + +class Window { +public: + // 当 App 进入前台 + static void OnForeground(); + // 当 App 进入后台 + static void OnBackground(); +}; + +class Device { +public: + static void SetCurrent(const std::shared_ptr &device); + static std::shared_ptr GetCurrent(); + + virtual ~Device() = default; + + // 当前 Device ID + virtual std::string GetDeviceID() = 0; + // 缓存目录 + virtual std::string GetCacheDir() = 0; + // CA 证书目录 (可选) + virtual std::string GetCaCertDir() = 0; + // 设备类型 + virtual DeviceType GetDeviceType(); +}; + +} diff --git a/Plugins/MacOS/tds_core.framework/Headers/platform.h.meta b/Plugins/MacOS/tds_core.framework/Headers/platform.h.meta new file mode 100644 index 0000000..f6fcfb1 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Headers/platform.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 79e571ceda3ec4319935dd13c243fb24 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Headers/tapsdk.h b/Plugins/MacOS/tds_core.framework/Headers/tapsdk.h new file mode 100644 index 0000000..5f5a957 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Headers/tapsdk.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +namespace tapsdk { + +class TDSUser; + +enum class Region : int { + CN = 0, + Global +}; + +class TDSUser { +public: + static void SetCurrent(const std::shared_ptr& user); + static std::shared_ptr GetCurrent(); + + TDSUser(const std::string& user_id = {}); + + virtual ~TDSUser() = default; + + virtual std::string GetUserId(); + virtual std::string GetUserName() = 0; + virtual bool ContainTapInfo() = 0; +private: + std::string user_id; +}; + +class Game { +public: + static void SetCurrent(const std::shared_ptr &game); + static std::shared_ptr GetCurrent(); + + virtual ~Game() = default; + + // 游戏 Game ID + virtual std::string GetGameID() = 0; + + // 游戏包名/Bundle ID + virtual std::string GetPackageName() = 0; +}; + +struct Config { + bool enable_duration_statistics = false; + Region region = Region::CN; +}; + +bool Init(const Config &config); + +} // namespace tapsdk diff --git a/Plugins/MacOS/tds_core.framework/Headers/tapsdk.h.meta b/Plugins/MacOS/tds_core.framework/Headers/tapsdk.h.meta new file mode 100644 index 0000000..6e03fc5 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Headers/tapsdk.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 19201ef530430481f93f19752c30b0a1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Resources.meta b/Plugins/MacOS/tds_core.framework/Resources.meta new file mode 100644 index 0000000..83e4a8e --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28c5ee5fa1ba94d9a8343d3614d34cef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Resources/Info.plist b/Plugins/MacOS/tds_core.framework/Resources/Info.plist new file mode 100644 index 0000000..e1d47d5 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Resources/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + tds_core + CFBundleIconFile + + CFBundleIdentifier + com.taptap.tapsdk + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + + CFBundleShortVersionString + + CSResourcesFileMapped + + + diff --git a/Plugins/MacOS/tds_core.framework/Resources/Info.plist.meta b/Plugins/MacOS/tds_core.framework/Resources/Info.plist.meta new file mode 100644 index 0000000..47ae7d3 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Resources/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 620a006473d4e4f70ab7e9225821f923 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions.meta b/Plugins/MacOS/tds_core.framework/Versions.meta new file mode 100644 index 0000000..f00ecc0 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66f4b6bfb60014034892e2ce0dcdb36e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A.meta b/Plugins/MacOS/tds_core.framework/Versions/A.meta new file mode 100644 index 0000000..7189561 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f5b2af7d9c384c0a8491862c55e1090 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Headers.meta b/Plugins/MacOS/tds_core.framework/Versions/A/Headers.meta new file mode 100644 index 0000000..a353c39 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Headers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e15b89c7af4a41e8bd275f401fa3086 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Headers/platform.h b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/platform.h new file mode 100644 index 0000000..dfb4e2a --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/platform.h @@ -0,0 +1,43 @@ +// +// Created by 甘尧 on 2023/7/7. +// +#pragma once + +#include +#include +#include + +namespace tapsdk::platform { + +enum class DeviceType { + Local, + Sandbox, + Cloud +}; + +class Window { +public: + // 当 App 进入前台 + static void OnForeground(); + // 当 App 进入后台 + static void OnBackground(); +}; + +class Device { +public: + static void SetCurrent(const std::shared_ptr &device); + static std::shared_ptr GetCurrent(); + + virtual ~Device() = default; + + // 当前 Device ID + virtual std::string GetDeviceID() = 0; + // 缓存目录 + virtual std::string GetCacheDir() = 0; + // CA 证书目录 (可选) + virtual std::string GetCaCertDir() = 0; + // 设备类型 + virtual DeviceType GetDeviceType(); +}; + +} diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Headers/platform.h.meta b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/platform.h.meta new file mode 100644 index 0000000..fee1e73 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/platform.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1640c043947d1436797b23ddf7bb3f67 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Headers/tapsdk.h b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/tapsdk.h new file mode 100644 index 0000000..5f5a957 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/tapsdk.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +namespace tapsdk { + +class TDSUser; + +enum class Region : int { + CN = 0, + Global +}; + +class TDSUser { +public: + static void SetCurrent(const std::shared_ptr& user); + static std::shared_ptr GetCurrent(); + + TDSUser(const std::string& user_id = {}); + + virtual ~TDSUser() = default; + + virtual std::string GetUserId(); + virtual std::string GetUserName() = 0; + virtual bool ContainTapInfo() = 0; +private: + std::string user_id; +}; + +class Game { +public: + static void SetCurrent(const std::shared_ptr &game); + static std::shared_ptr GetCurrent(); + + virtual ~Game() = default; + + // 游戏 Game ID + virtual std::string GetGameID() = 0; + + // 游戏包名/Bundle ID + virtual std::string GetPackageName() = 0; +}; + +struct Config { + bool enable_duration_statistics = false; + Region region = Region::CN; +}; + +bool Init(const Config &config); + +} // namespace tapsdk diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Headers/tapsdk.h.meta b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/tapsdk.h.meta new file mode 100644 index 0000000..b947a91 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Headers/tapsdk.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 597774ef282ac49c18af7ae975cb4fd7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Resources.meta b/Plugins/MacOS/tds_core.framework/Versions/A/Resources.meta new file mode 100644 index 0000000..1bbb82a --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd9a234c699bf4c9e98e712487c51967 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Resources/Info.plist b/Plugins/MacOS/tds_core.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..e1d47d5 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + tds_core + CFBundleIconFile + + CFBundleIdentifier + com.taptap.tapsdk + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + + CFBundleShortVersionString + + CSResourcesFileMapped + + + diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/Resources/Info.plist.meta b/Plugins/MacOS/tds_core.framework/Versions/A/Resources/Info.plist.meta new file mode 100644 index 0000000..f8fbd2b --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/Resources/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 528eb212cd91f41bfae2a61109fc536f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/tds_core b/Plugins/MacOS/tds_core.framework/Versions/A/tds_core new file mode 100644 index 0000000..8e321a9 Binary files /dev/null and b/Plugins/MacOS/tds_core.framework/Versions/A/tds_core differ diff --git a/Plugins/MacOS/tds_core.framework/Versions/A/tds_core.meta b/Plugins/MacOS/tds_core.framework/Versions/A/tds_core.meta new file mode 100644 index 0000000..cd6360d --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/A/tds_core.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ffb140e037e44455d97dc196ffccbf34 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current.meta b/Plugins/MacOS/tds_core.framework/Versions/Current.meta new file mode 100644 index 0000000..058da14 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2535b0aa3d51c479c8a6a6256d9a0b53 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Headers.meta b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers.meta new file mode 100644 index 0000000..bf40843 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 452cfdc2126144eaaaa1370b15622dc7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/platform.h b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/platform.h new file mode 100644 index 0000000..dfb4e2a --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/platform.h @@ -0,0 +1,43 @@ +// +// Created by 甘尧 on 2023/7/7. +// +#pragma once + +#include +#include +#include + +namespace tapsdk::platform { + +enum class DeviceType { + Local, + Sandbox, + Cloud +}; + +class Window { +public: + // 当 App 进入前台 + static void OnForeground(); + // 当 App 进入后台 + static void OnBackground(); +}; + +class Device { +public: + static void SetCurrent(const std::shared_ptr &device); + static std::shared_ptr GetCurrent(); + + virtual ~Device() = default; + + // 当前 Device ID + virtual std::string GetDeviceID() = 0; + // 缓存目录 + virtual std::string GetCacheDir() = 0; + // CA 证书目录 (可选) + virtual std::string GetCaCertDir() = 0; + // 设备类型 + virtual DeviceType GetDeviceType(); +}; + +} diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/platform.h.meta b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/platform.h.meta new file mode 100644 index 0000000..5914f90 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/platform.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 269e81bb072a3466aa97f4d43699a352 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/tapsdk.h b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/tapsdk.h new file mode 100644 index 0000000..5f5a957 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/tapsdk.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +namespace tapsdk { + +class TDSUser; + +enum class Region : int { + CN = 0, + Global +}; + +class TDSUser { +public: + static void SetCurrent(const std::shared_ptr& user); + static std::shared_ptr GetCurrent(); + + TDSUser(const std::string& user_id = {}); + + virtual ~TDSUser() = default; + + virtual std::string GetUserId(); + virtual std::string GetUserName() = 0; + virtual bool ContainTapInfo() = 0; +private: + std::string user_id; +}; + +class Game { +public: + static void SetCurrent(const std::shared_ptr &game); + static std::shared_ptr GetCurrent(); + + virtual ~Game() = default; + + // 游戏 Game ID + virtual std::string GetGameID() = 0; + + // 游戏包名/Bundle ID + virtual std::string GetPackageName() = 0; +}; + +struct Config { + bool enable_duration_statistics = false; + Region region = Region::CN; +}; + +bool Init(const Config &config); + +} // namespace tapsdk diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/tapsdk.h.meta b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/tapsdk.h.meta new file mode 100644 index 0000000..3f4f636 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Headers/tapsdk.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ead3e8ecbb90e40f5b15771a7f2dd1a8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Resources.meta b/Plugins/MacOS/tds_core.framework/Versions/Current/Resources.meta new file mode 100644 index 0000000..1b1349d --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7379c1ce1687946c194256ae26f3256e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Resources/Info.plist b/Plugins/MacOS/tds_core.framework/Versions/Current/Resources/Info.plist new file mode 100644 index 0000000..e1d47d5 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Resources/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + tds_core + CFBundleIconFile + + CFBundleIdentifier + com.taptap.tapsdk + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + + CFBundleShortVersionString + + CSResourcesFileMapped + + + diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/Resources/Info.plist.meta b/Plugins/MacOS/tds_core.framework/Versions/Current/Resources/Info.plist.meta new file mode 100644 index 0000000..ba78431 --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/Resources/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0fa256e4c39fb41f9953ec9113df7e31 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/tds_core b/Plugins/MacOS/tds_core.framework/Versions/Current/tds_core new file mode 100644 index 0000000..8e321a9 Binary files /dev/null and b/Plugins/MacOS/tds_core.framework/Versions/Current/tds_core differ diff --git a/Plugins/MacOS/tds_core.framework/Versions/Current/tds_core.meta b/Plugins/MacOS/tds_core.framework/Versions/Current/tds_core.meta new file mode 100644 index 0000000..04a375f --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/Versions/Current/tds_core.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a9cb9c6628e9349dc88f38761dcac7cc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/MacOS/tds_core.framework/tds_core b/Plugins/MacOS/tds_core.framework/tds_core new file mode 100644 index 0000000..8e321a9 Binary files /dev/null and b/Plugins/MacOS/tds_core.framework/tds_core differ diff --git a/Plugins/MacOS/tds_core.framework/tds_core.meta b/Plugins/MacOS/tds_core.framework/tds_core.meta new file mode 100644 index 0000000..dc1bcbd --- /dev/null +++ b/Plugins/MacOS/tds_core.framework/tds_core.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 10878d26fe6d2496494aff2d03471c52 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Windows.meta b/Plugins/Windows.meta new file mode 100644 index 0000000..86e9282 --- /dev/null +++ b/Plugins/Windows.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b530accc5f0314e7d9a15d7281ec5714 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Windows/bindings-csharp.dll b/Plugins/Windows/bindings-csharp.dll new file mode 100644 index 0000000..eb5f42b Binary files /dev/null and b/Plugins/Windows/bindings-csharp.dll differ diff --git a/Plugins/Windows/bindings-csharp.dll.meta b/Plugins/Windows/bindings-csharp.dll.meta new file mode 100644 index 0000000..0ec7802 --- /dev/null +++ b/Plugins/Windows/bindings-csharp.dll.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: ac6acd2e2354592409066f1ace659a21 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Windows + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS.meta b/Plugins/iOS.meta new file mode 100644 index 0000000..9ba314a --- /dev/null +++ b/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e935f15b899147eaa8b62cdef502046 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource.meta b/Plugins/iOS/Resource.meta new file mode 100644 index 0000000..9f336ae --- /dev/null +++ b/Plugins/iOS/Resource.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2192f0da58ae410089b7aabfc9375ca4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle.meta b/Plugins/iOS/Resource/TapCommonResource.bundle.meta new file mode 100644 index 0000000..927f134 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle.meta @@ -0,0 +1,81 @@ +fileFormatVersion: 2 +guid: 862aa0341df21484eb4a08a6ee21f9c3 +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images.meta new file mode 100644 index 0000000..7223220 --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b90cb19a0ccd14069b203014806a6748 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/TapTapImage.png b/Plugins/iOS/Resource/TapCommonResource.bundle/images/TapTapImage.png new file mode 100644 index 0000000..279c364 Binary files /dev/null and b/Plugins/iOS/Resource/TapCommonResource.bundle/images/TapTapImage.png differ diff --git a/Plugins/iOS/Resource/TapCommonResource.bundle/images/TapTapImage.png.meta b/Plugins/iOS/Resource/TapCommonResource.bundle/images/TapTapImage.png.meta new file mode 100644 index 0000000..51fd63d --- /dev/null +++ b/Plugins/iOS/Resource/TapCommonResource.bundle/images/TapTapImage.png.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9f61354f84868413fb1bfdf7b8652427 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonDelegate.h b/Plugins/iOS/TapCommonDelegate.h new file mode 100644 index 0000000..e2dc244 --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.h @@ -0,0 +1,16 @@ +// +// TapDelegate.h +// Unity-iPhone +// +// Created by xe on 2021/7/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapCommonDelegate : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonDelegate.h.meta b/Plugins/iOS/TapCommonDelegate.h.meta new file mode 100644 index 0000000..6bf7977 --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.h.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 194ed5d2453144ac9b98c5c7cf599e9c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonDelegate.mm b/Plugins/iOS/TapCommonDelegate.mm new file mode 100644 index 0000000..17b306d --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.mm @@ -0,0 +1,33 @@ +// +// TapDelegate.m +// Unity-iPhone +// +// Created by xe on 2021/7/14. +// + +#import +#import +#import +#include "AppDelegateListener.h" +#include "LifeCycleListener.h" +#import "TapCommonDelegate.h" +#import + +@implementation TapCommonDelegate + ++(void) load{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken,^{ + + NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; + [nc addObserverForName:kUnityOnOpenURL object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) { + if ([note.userInfo isKindOfClass: [NSMutableDictionary class]]) { + NSURL* url = [note.userInfo objectForKey:@"url"]; + [TDSHandleUrl handleOpenURL:url]; + } + }]; + + }); +} + +@end diff --git a/Plugins/iOS/TapCommonDelegate.mm.meta b/Plugins/iOS/TapCommonDelegate.mm.meta new file mode 100644 index 0000000..ea0e182 --- /dev/null +++ b/Plugins/iOS/TapCommonDelegate.mm.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: 04967bfc53c484d1c81447df7cb1822b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework.meta b/Plugins/iOS/TapCommonSDK.framework.meta new file mode 100644 index 0000000..c5c8b68 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: 2a236b3c23efa4a80b48d344322d8741 +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers.meta b/Plugins/iOS/TapCommonSDK.framework/Headers.meta new file mode 100644 index 0000000..ac3edeb --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3f2251a8c639641849fc58c5b25866ef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h new file mode 100644 index 0000000..9523395 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h @@ -0,0 +1,20 @@ +// +// ActionModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ActionModel : NSObject +@property (nonatomic, copy) NSString *click; +@property (nonatomic, copy) NSString *like; +@property (nonatomic, copy) NSString *comment; +@property (nonatomic, copy) NSString *collect; +@property (nonatomic, copy) NSString *impression; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h.meta new file mode 100644 index 0000000..c26b89e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ActionModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9897b13ac84da417e98a989f9b624aed +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h new file mode 100644 index 0000000..e163f5f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h @@ -0,0 +1,16 @@ +// +// ComponentMessageDelegate.h +// TapCommonSDK +// +// Created by Bottle K on 2021/5/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@protocol ComponentMessageDelegate + +- (void)onMessageWithCode:(NSInteger)code extras:(NSDictionary *)extras; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta new file mode 100644 index 0000000..77f9be6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e1658a9397048471f813ff6018b961ef +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h new file mode 100644 index 0000000..cc6396e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h @@ -0,0 +1,19 @@ +// +// EngineBridgeError.h +// EngineBridge +// +// Created by xe on 2020/9/28. +// Copyright © 2020 xe. All rights reserved. +// +#import + +typedef NSString *KLTypeStr NS_STRING_ENUM; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_PARSE_ERROR; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_SERVICE_ERROR; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_METHOD_ERROR; + +FOUNDATION_EXPORT KLTypeStr const COMMAND_ARGS_ERROR; + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h.meta new file mode 100644 index 0000000..ed44258 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/EngineBridgeError.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ac5b3af18a761497abe1137fb4ab9b3b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h new file mode 100644 index 0000000..f2fff07 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h @@ -0,0 +1,44 @@ +// +// LoginModel.h +// TapCommonSDK +// +// Created by Bottle K on 2021/6/21. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +//登录流程中触发的事件 +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_AUTHORIZE_START; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_OPEN; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_BACK; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_TOKEN; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_PROFILE; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_SUCCESS; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_FAIL; +FOUNDATION_EXPORT NSString *const LOGIN_ACTION_TAPTAP_AUTHORIZE_CANCEL; + +//登录类型 +FOUNDATION_EXPORT NSString *const LOGIN_TYPE_TAPTAP; +FOUNDATION_EXPORT NSString *const LOGIN_TYPE_WEBVIEW; +FOUNDATION_EXPORT NSString *const LOGIN_TYPE_AUTO; + +@interface LoginModel : NSObject +//每次登录流程唯一ID +@property (nonatomic, copy) NSString *login_session_id; + +//登录流程中触发的事件 +@property (nonatomic, copy) NSString *login_action; + +//登录类型 +@property (nonatomic, copy, nullable) NSString *login_type; + +//错误code +@property (nonatomic, copy, nullable) NSString *login_error_code; + +//错误message +@property (nonatomic, copy, nullable) NSString *login_error_msg; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h.meta new file mode 100644 index 0000000..9ef6020 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/LoginModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f8dc55d8f1ba04ed9a34f076ed1f38f6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h new file mode 100644 index 0000000..0e495b7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h @@ -0,0 +1,25 @@ +// +// NSArray+Safe.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/15. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + +@interface NSArray (Safe) + +- (void)tds_each:(void (^)(id object, NSUInteger index))block; + +- (void)tds_apply:(void (^)(id object, NSUInteger index))block; + +- (NSArray *)tds_map:(id (^)(id object, NSUInteger index))block; + +- (id)tds_reduce:(id (^)(id accumulated, id object))block; + +- (NSArray *)tds_filter:(BOOL (^)(id object, NSUInteger index))block; + +- (id)tds_safeObjectAtIndex:(NSUInteger)index; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h.meta new file mode 100644 index 0000000..7755793 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSArray+Safe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c5d436fef199b45c38f49fa9054703c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h new file mode 100644 index 0000000..8580684 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h @@ -0,0 +1,16 @@ +// +// NSBundle+Tools.h +// TDSAchievement +// +// Created by TapTap-David on 2020/8/26. +// Copyright © 2020 taptap. All rights reserved. +// +#import + +@interface NSBundle (Tools) ++ (instancetype)tds_bundleName:(NSString *)bundleName aClass:(Class)aClass; +- (NSString *)tds_localizedStringForKey:(NSString *)key value:(NSString *)value; +- (NSString *)tds_localizedStringForKey:(NSString *)key; + +- (UIImage *)tds_imageName:(NSString *)imageName; +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h.meta new file mode 100644 index 0000000..e7f9da3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSBundle+Tools.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d867a734f0c7044b58a9ffce8ecc0499 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h new file mode 100644 index 0000000..179ce72 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h @@ -0,0 +1,22 @@ +// +// NSData+JSON.h +// NativeApp +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// + +#import + +@interface NSData (JSON) + +- (NSArray *)tds_arrayFromJsonData; + +- (NSDictionary *)tds_dictionaryFromJsonData; + +- (NSString *)tds_stringFromData; + +- (NSData *)tds_aes256Encrypt:(NSString *)key; +- (NSData *)tds_aes256Decrypt:(NSString *)key; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h.meta new file mode 100644 index 0000000..db3f421 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSData+Tools.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 32d88209bb83f4a399874b4ecaa7d896 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h new file mode 100644 index 0000000..57fa4af --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h @@ -0,0 +1,18 @@ +// +// NSDictionary+JSON.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/11. +// Copyright © 2018 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSDictionary (JSON) +- (NSString *)tds_jsonString; +- (NSString *)tds_jsonStringWithoutOptions:(NSJSONWritingOptions)opt; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h.meta new file mode 100644 index 0000000..8ed7bdd --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+JSON.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f2dbebcbf1fdb44fbaa24479b004010b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h new file mode 100644 index 0000000..94c23d6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h @@ -0,0 +1,24 @@ +// +// NSDictionary+TDSSafe.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSDictionary (TDSSafe) + +- (BOOL)tds_boolForKey:(NSString *)key; +- (NSInteger)tds_integerForKey:(NSString *)key; +- (NSDictionary *)tds_dicForKey:(NSString *)key; +- (NSString *)tds_stringForKey:(NSString *)key; +- (NSArray *)tds_arrayForKey:(NSString *)key; +- (NSSet *)tds_setForKey:(NSString *)key; +- (NSNumber *)tds_numberForKey:(NSString *)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h.meta new file mode 100644 index 0000000..e3b65e6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSDictionary+TDSSafe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 749a4e26ad2894f7d9593728922707ae +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h new file mode 100644 index 0000000..f597867 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h @@ -0,0 +1,19 @@ +// +// NSError+Ext.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/22. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSError (Ext) ++ (instancetype)errorWithMessage:(NSString *)errorMsg code:(NSInteger)code; + ++ (instancetype)errorWithContent:(NSString *)content message:(NSString *)message code:(NSInteger)code; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta new file mode 100644 index 0000000..c66e111 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1240b79f0e06b4c0f93b313cdb253c56 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h new file mode 100644 index 0000000..1c3f0d9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h @@ -0,0 +1,23 @@ +// +// NSMutableArray+Safe.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/24. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSMutableArray (Safe) +- (void)tt_safeAddObject:(id)anObject; + +- (void)tt_addNonNullObject:(id)anObject; + +- (void)tt_safeInsertObject:(id)anObject atIndex:(NSUInteger)index; + +- (void)tt_safeReplaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h.meta new file mode 100644 index 0000000..099a34e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSMutableArray+Safe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6279a5b7d9354e738e69e65d3f1b342 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h new file mode 100644 index 0000000..08a080d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h @@ -0,0 +1,23 @@ +// +// NSObject+TDSCoding.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSObject (TDSCoding) +/** + * 解码(从文件中解析对象) + */ +- (void)tds_decode:(NSCoder *)decoder; +/** + * 编码(将对象写入文件中) + */ +- (void)tds_encode:(NSCoder *)encoder; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h.meta new file mode 100644 index 0000000..65d3cc1 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSCoding.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b5aa68b87977e4c8dbb7ef93823b2cd3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h new file mode 100644 index 0000000..72498f5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h @@ -0,0 +1,30 @@ +// +// NSObject+TDSModel.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSModel +@optional + ++ (NSDictionary *)replacedKeyFromPropertyName; ++ (NSString *)replacedKeyFromPropertyName:(NSString *)propertyName; ++ (NSDictionary *)objectClassInArray; ++ (Class)objectClassInArray:(NSString *)propertyName; + +@end + +@interface NSObject (TDSModel) + ++ (instancetype)tds_modelWithKeyValues:(id)keyValues; + +- (NSDictionary *)tds_keyValues; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h.meta new file mode 100644 index 0000000..5adb80b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 402bc152e9881447692a9b97a7708eea +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h new file mode 100644 index 0000000..d86dcf6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h @@ -0,0 +1,25 @@ +// +// NSObject+TDSProperty.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^TDSClassesEnumerator) (Class cls, BOOL *stop); + +typedef void (^TDSPropertiesEnumerator) (TDSProperty *property, BOOL *stop); + +@interface NSObject (TDSProperty) ++ (void)tds_enumerateProperties:(TDSPropertiesEnumerator)enumerator; + ++ (void)tds_enumerateClasses:(TDSClassesEnumerator)enumerator; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h.meta new file mode 100644 index 0000000..bd7ef8b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSObject+TDSProperty.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7192e4902586440b1af004cec3c50754 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h new file mode 100644 index 0000000..48d156f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h @@ -0,0 +1,34 @@ +// +// NSString+Tools.h +// TDS +// +// Created by JiangJiahao on 2018/4/24. +// Copyright © 2018年 dyy. All rights reserved. +// + +#import + +@interface NSString (Tools) +- (NSString *)tds_URLEncodedString; +- (NSString *)tds_URLDecodedString; +///反转字符串 +- (NSString *)tds_reverse; + +// MD5 hash of the file on the filesystem specified by path ++ (NSString *)tds_stringWithMD5OfFile:(NSString *)path; +// The string's MD5 hash +- (NSString *)tds_MD5Hash; + +// base64 +- (NSString *)tds_base64Encode; +- (NSString *)tds_base64Decode; + +// aes256 +- (NSString *)tds_aes256Encrypt:(NSString *)key; +- (NSString *)tds_aes256Decrypt:(NSString *)key; + +/// 是否是空字符串 ++ (BOOL)tds_isEmpty:(NSString *)string; + +- (NSDictionary *)tds_toDictionary; +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h.meta new file mode 100644 index 0000000..10a7108 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NSString+Tools.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8766c0450976140bcaeec502bd5612e4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h new file mode 100644 index 0000000..cf37c6b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h @@ -0,0 +1,20 @@ +// +// NetworkStateModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/3/23. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NetworkStateModel : NSObject +@property (nonatomic, copy) NSString *session_id; //每次启动唯一ID +@property (nonatomic, copy) NSString *host; //服务器 +@property (nonatomic, assign) NSInteger code; //返回码200成功 +@property (nonatomic, assign) CGFloat delay; //网络延迟时间(毫秒) +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h.meta new file mode 100644 index 0000000..cecf35f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/NetworkStateModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 86964f891f7994acd8f8c62815226523 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h new file mode 100644 index 0000000..636f720 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h @@ -0,0 +1,37 @@ +// +// PageModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +//页面唯一id +FOUNDATION_EXPORT NSString *const PAGE_ID_TAPTAP_AUTHORIZE_WEB; +FOUNDATION_EXPORT NSString *const PAGE_ID_TAPTAP_AUTHORIZE_TAPTAPCLIENT; +FOUNDATION_EXPORT NSString *const PAGE_ID_GAME; +//页面别名 +FOUNDATION_EXPORT NSString *const PAGE_NAME_TAPTAP_AUTHORIZE_WEB; +FOUNDATION_EXPORT NSString *const PAGE_NAME_TAPTAP_AUTHORIZE_TAPTAPCLIENT; +FOUNDATION_EXPORT NSString *const PAGE_NAME_GAME; + +//页面事件名 +FOUNDATION_EXPORT NSString *const PAGE_ACTION_APPEAR; +FOUNDATION_EXPORT NSString *const PAGE_ACTION_DISAPPEAR; + +@interface PageModel : NSObject +//页面唯一id +@property (nonatomic, copy, nullable) NSString *page_id; + +//页面别名 +@property (nonatomic, copy, nullable) NSString *page_name; + +//页面事件名 +@property (nonatomic, copy, nullable) NSString *page_action; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h.meta new file mode 100644 index 0000000..52a4502 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PageModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 68f1690a0bca84d308b0f1528322b804 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h new file mode 100644 index 0000000..a3e4a25 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h @@ -0,0 +1,17 @@ +// +// PlatformXUA.h +// TapCommonSDK +// +// Created by Bottle K on 2021/6/21. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PlatformXUA : NSObject +@property (nonatomic, copy) NSDictionary *xuaMap; ++ (instancetype)shareInstance; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta new file mode 100644 index 0000000..b6f1701 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4b9cdc090fd1741869a75a76321b7b9f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h new file mode 100644 index 0000000..6d995b7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h @@ -0,0 +1,45 @@ +// +// TDSAccount.h +// TDSCommon +// +// Created by Bottle K on 2020/9/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSInteger, TDSAccountType) { + TAP, + XD, + XDG, + TYPE_TDS, +LC +}; + +@interface TDSAccount : NSObject + +/// xd token +@property (nonatomic, copy, readonly) NSString *token; +/// tap/tds +@property (nonatomic, copy, readonly) NSString *kid; +@property (nonatomic, copy, readonly) NSString *accessToken; +@property (nonatomic, copy, readonly) NSString *tokenType; +@property (nonatomic, copy, readonly) NSString *macKey; +@property (nonatomic, copy, readonly) NSString *macAlgorithm; +/// tds +@property (nonatomic, assign, readonly) long expireIn; +/// lc +@property (nonatomic, copy, readonly) NSString *clientId; +@property (nonatomic, copy, readonly) NSString *clientToken; +@property (nonatomic, copy, readonly) NSString *sessionToken; + +- (instancetype)initWithToken:(NSString *)token type:(TDSAccountType)type; + +- (instancetype)initWithLC:(NSString *)token type:(TDSAccountType)type; + +- (TDSAccountType)getAccountType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h.meta new file mode 100644 index 0000000..a7331a6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccount.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f938d51d9e4254d72a6a975e611138f2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountManager.h new file mode 100644 index 0000000..28d9c9d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountManager.h @@ -0,0 +1,31 @@ +// +// TDSAccountManager.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2023/7/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +FOUNDATION_EXTERN NSNotificationName const TapUserLoginNotification; +FOUNDATION_EXTERN NSNotificationName const TapUserLogoutNotification; +FOUNDATION_EXTERN NSNotificationName const TDSUserLoginNotification; +FOUNDATION_EXTERN NSNotificationName const TDSUserInfoUpdateNotification; +FOUNDATION_EXTERN NSNotificationName const TDSUserLogoutNotification; +FOUNDATION_EXTERN NSNotificationName const TDSCombineUserIDChangedNotification; + +@interface TDSAccountManager : NSObject + ++ (TDSAccountManager *)shareInstance; + +@property (nonatomic, strong, nullable) NSDictionary *tapUserDic; +@property (nonatomic, strong, nullable) NSDictionary *tdsUserDic; +// 获得聚合的UserID(目前是TapUser和TDSUser), 是一个Json字符串 +@property (nonatomic, strong, readonly) NSString *combineUserID; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountManager.h.meta new file mode 100644 index 0000000..c08d472 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e85ec6540d8ad434daddd8464eafcc5d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h new file mode 100644 index 0000000..813fae7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h @@ -0,0 +1,19 @@ +// +// TDSAccountNotification.h +// TapBootstrapSDK +// +// Created by Bottle K on 2021/4/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const TAP_LOGIN_SUCCESS_NOTIFICATION; +extern NSString *const TAP_LOGIN_FAIL_NOTIFICATION; + +@interface TDSAccountNotification : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h.meta new file mode 100644 index 0000000..d1311b3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountNotification.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f8edd30260e2749efb39357d51f7b4ad +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h new file mode 100644 index 0000000..2e3c970 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h @@ -0,0 +1,22 @@ +// +// TDSAccountProvider.h +// TapCommonSDK +// +// Created by Bottle K on 2021/3/30. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSAccountProvider + +- (nullable TDSAccount *)getAccount; + +- (nullable NSDictionary *)getLocalUserInfo; + +- (void)getAccountUser:(void (^)(NSDictionary *_Nullable userInfo, NSError *_Nullable error))handler; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h.meta new file mode 100644 index 0000000..e29c689 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAccountProvider.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 10c81d7624db649e88315696c51a0e5f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h new file mode 100644 index 0000000..f0f5476 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h @@ -0,0 +1,80 @@ +// +// AsyncHttp.h +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// 简单HTTP请求 + +#import +#import + +extern NSString *const TDS_TIMEOUTKEY; +extern NSString *const TDS_HTTPMETHODKEY; +extern NSString *const TDS_HTTPBODYKEY; +extern NSString *const TDS_DATAFORMAT; +extern NSString *const TDS_CACHE_POLICY_KEY; +extern NSString *const TDS_PROTOBUF_KEY; + +/** + header + */ +extern NSString *const TDS_AUTH_KEY; + + +typedef void(^CallBackBlock)(TDSHttpResult *result); +typedef void(^GetAllCallBack)(NSArray *resultArr,BOOL successAll); + + +@interface TDSAsyncHttp : NSObject +@property (nonatomic,copy) CallBackBlock callBackBlock; +@property (nonatomic,copy) CallBackBlock failedCallback; + +- (void)stopTask; +- (void)retryTask; + +- (void)handleSuccessResult:(TDSHttpResult *)result; +- (void)handleFailResult:(TDSHttpResult *)result; + +/// GET请求 +/// @param urlStr url +/// @param requestParams 网络请求参数,如超时、格式等 +/// @param customHeaderParams 自定义请求头参数 +/// @param params 本次请求参数 +/// @param callBackBlock 成功回调 +/// @param failedCallback 失败回调 +- (TDSAsyncHttp *)httpGet:(NSString *)urlStr + requestParams:(NSDictionary *)requestParams + customHeader:(NSDictionary *)customHeaderParams + params:(NSDictionary *)params + callBack:(CallBackBlock)callBackBlock failedCallback:(CallBackBlock)failedCallback; + +/** + 多个get请求并发,同时返回 + + @param urlStrArr URL数组 + @param requestParamsArr 请求参数数组 + @param customHeaderParamsArr 自定义请求头数组 + @param paramsDicArr 参数数组 + @param callback 回掉 + */ +- (void)httpGetAll:(NSArray *)urlStrArr + requestParamsArr:(NSArray *)requestParamsArr + customHeadersArr:(NSArray *)customHeaderParamsArr + params:(NSArray *)paramsDicArr + callback:(GetAllCallBack)callback; + +/// POST请求 +/// @param urlStr URL +/// @param requestParams 网络请求参数,如超时、数据格式、请求头等 +/// @param customHeaderParams 自定义请求头参数 +/// @param params 本次请求参数 +/// @param callBackBlock 成功回调 +/// @param failedCallback 失败回调 +- (TDSAsyncHttp *)httpPost:(NSString *)urlStr + requestParams:(NSDictionary *)requestParams + customHeader:(NSDictionary *)customHeaderParams + params:(NSDictionary *)params + callBack:(CallBackBlock)callBackBlock + failedCallback:(CallBackBlock)failedCallback; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h.meta new file mode 100644 index 0000000..6d65ef3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAsyncHttp.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2cc60f09986ca4aa0a84dfe7781d926d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h new file mode 100644 index 0000000..04fc30d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h @@ -0,0 +1,78 @@ +// +// XDGAutoLayout.h +// XDG +// +// Created by JiangJiahao on 2020/8/20. +// Copyright © 2020 JiangJiahao. All rights reserved. +// 简单自动布局类 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSAutoLayout : NSObject + ++ (void)openAutoLayout:(UIView *)targetView; ++ (void)safeAreaLayout:(BOOL)safe; + ++ (NSLayoutConstraint *)layoutHeight:(UIView *)targetView height:(CGFloat)height; ++ (NSLayoutConstraint *)layoutWidth:(UIView *)targetView width:(CGFloat)width; + +/// 相等约束相等布局 +/// @param view1 view1 +/// @param view2 view2 ++ (void)layoutViewEqual:(UIView *)view1 toView:(UIView *)view2; + ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr; + ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr + offset:(CGFloat)offset; + ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr2; + +/// 约束两个view相等 +/// @param view1 view1 +/// @param attr1 view1约束 +/// @param view2 view2 +/// @param attr2 view2约束 +/// @param constant 距离 ++ (NSLayoutConstraint *)layoutViewEqual:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(UIView *)view2 + attribute:(NSLayoutAttribute)attr2 + constant:(CGFloat)constant; + +/// 约束两个view,更大 +/// @param view1 view1 +/// @param attr1 view1约束 +/// @param view2 view2 +/// @param attr2 view2约束 +/// @param constant 距离 ++ (NSLayoutConstraint *)layoutViewGreater:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(nullable UIView *)view2 + attribute:(NSLayoutAttribute)attr2 + constant:(CGFloat)constant; + +/// 约束两个view,更小 +/// @param view1 view1 +/// @param attr1 view1约束 +/// @param view2 view2 +/// @param attr2 view2约束 +/// @param constant 距离 ++ (NSLayoutConstraint *)layoutViewLesser:(UIView *)view1 + attribute:(NSLayoutAttribute)attr1 + toView:(nullable UIView *)view2 + attribute:(NSLayoutAttribute)attr2 + constant:(CGFloat)constant; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h.meta new file mode 100644 index 0000000..bef0a5a --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSAutoLayout.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7aae01ebd636b43968fcffe171dcee72 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h new file mode 100644 index 0000000..ead0c6f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h @@ -0,0 +1,26 @@ +// +// TDSSDK.h +// TDSCommon +// +// Created by Bottle K on 2020/10/13. +// + +#import +#import + +#define TapCommonSDK @"TapCommon" +#define TapCommonSDK_VERSION_NUMBER @"32200001" +#define TapCommonSDK_VERSION @"3.22.0" + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSBaseManager : NSObject + ++ (TDSBaseManager *)shareInstance; ++ (void)setDurationStatisticsEnabled:(BOOL)enable; ++ (void)initWithSDKConfig:(TapConfig *)config; ++ (TapConfig *)getConfig; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h.meta new file mode 100644 index 0000000..5e52a4f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBaseManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0c439c30a73684bf7bbe5848d06b6ebb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h new file mode 100644 index 0000000..5cca4f9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h @@ -0,0 +1,39 @@ +// +// bridge.h +// bridge +// +// Created by xe on 2020/10/15. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +#import +#import +#import +#import +#import +#import + +//! Project version number for bridge. +FOUNDATION_EXPORT double bridgeVersionNumber; + +//! Project version string for bridge. +FOUNDATION_EXPORT const unsigned char bridgeVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +@interface TDSBridge : NSObject + +@property (nonatomic, weak) iddelegte; + ++ (instancetype)instance; + +- (void)callHandler:(NSString*) command; + +- (void)registerHandler:(NSString*) command + bridgeCallback:(id) callback; + +@end + + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h.meta new file mode 100644 index 0000000..4f16c8e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridge.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4e1ef3015eb4348c6bff2e7a494381cf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h new file mode 100644 index 0000000..46902f7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h @@ -0,0 +1,16 @@ +// +// BridgeCallback.h +// Bridge +// +// Created by xe on 2020/10/16. +// Copyright © 2020 xe. All rights reserved. +// +#import + +@protocol TDSBridgeCallback + +@optional + +- (void)onResult:(NSString *)msg; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta new file mode 100644 index 0000000..6b1939e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a911b11ed5a6942109098b62b2173984 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h new file mode 100644 index 0000000..3efde93 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h @@ -0,0 +1,13 @@ +// +// BridgeException.h +// EngineBridge +// +// Created by xe on 2020/10/9. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +@interface TDSBridgeException : NSException +@end + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h.meta new file mode 100644 index 0000000..ebb8343 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeException.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6d87a6389e26d468aa7f77022f51573d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h new file mode 100644 index 0000000..69c4c66 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h @@ -0,0 +1,19 @@ +// +// EngineBridgeProxy.h +// Bridge +// +// Created by xe on 2020/10/15. +// Copyright © 2020 xe. All rights reserved. +// + +#import +#import +#import + +@interface TDSBridgeProxy : NSObject + ++ (TDSBridgeProxy *)shareInstance; + +- (void)onResult:(NSString*) result; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h.meta new file mode 100644 index 0000000..f7a3f13 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeProxy.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e26d7f67a320541ccb974814fecba5d8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h new file mode 100644 index 0000000..32a21b6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h @@ -0,0 +1,28 @@ +// +// BridgeTool.h +// EngineBridge +// +// Created by xe on 2020/10/9. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +@interface TDSBridgeTool : NSObject + ++ (BOOL)isEmpty:(NSString *)str; + ++ (NSString *)jsonStringWithString:(NSString *)string; + ++ (NSString *)jsonStringWithArray:(NSArray *)array; + ++ (NSString *)jsonStringWithDictionary:(NSDictionary *)dictionary; + ++ (NSString *)jsonStringWithObject:(id)model; + ++ (NSString *)jsonStringWithMutaDic:(NSDictionary *)dic; + ++ (NSDictionary *)dictionaryWithModel:(id)model; + +@end + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h.meta new file mode 100644 index 0000000..9acb882 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeTool.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a340e574cb7314d87a30111be652f741 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h new file mode 100644 index 0000000..2b64b48 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h @@ -0,0 +1,21 @@ +// +// TDSButton.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSButton : UIButton + +/** +扩展的点击区域,往外扩展是负数 + */ +@property (nonatomic, assign) UIEdgeInsets extensionTouchInsets; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h.meta new file mode 100644 index 0000000..4a9a0fc --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSButton.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c8ea6c1e227dc46b4a5c9f855d6cbeb5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h new file mode 100644 index 0000000..2cf42ba --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h @@ -0,0 +1,29 @@ +// +// Command.h +// EngineBridge +// +// Created by xe on 2020/9/28. +// Copyright © 2020 xe. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + + +@interface TDSCommand : NSObject + +@property (nonatomic,copy) NSString* service; +@property (nonatomic,copy) NSString* method; +@property (nonatomic,copy) NSString* args; +@property (nonatomic,copy) NSString* callbackId; +@property (nonatomic,assign) BOOL callback; +@property (nonatomic,assign) BOOL onceTime; + ++ (TDSCommand*)constructorCommand:(NSString*)commandJSON; + +- (NSString*)toJSON; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h.meta new file mode 100644 index 0000000..62e00f2 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommand.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 571682f894bed46dcb19e6d30a450fc9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h new file mode 100644 index 0000000..49c7b71 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h @@ -0,0 +1,19 @@ +// +// CommandTask.h +// EngineBridge +// +// Created by xe on 2020/9/29. +// Copyright © 2020 xe. All rights reserved. +// +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommandTask : NSObject + +- (void)execute:(TDSCommand *)command brigeCallback:(void (^)(NSString * resultJSON))result; + +@end + +NS_ASSUME_NONNULL_END + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h.meta new file mode 100644 index 0000000..ec63eb1 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommandTask.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a8d66bc107abf473d950f58c5c441e1f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h new file mode 100644 index 0000000..1116f2d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h @@ -0,0 +1,21 @@ +// +// TDSCommonHeader.h +// TDSCommon +// +// Created by Bottle K on 2020/9/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonHeader : NSObject + +- (instancetype)init:(NSString *)sdkName + sdkVersionCode:(NSString *)sdkVersionCode + sdkVersionName:(NSString *)sdkVersionName; + +- (NSString *)getXUAValue; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h.meta new file mode 100644 index 0000000..06e5b57 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonHeader.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9e9fab8d7489840379877d32b8ad1218 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h new file mode 100644 index 0000000..c1cef7d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h @@ -0,0 +1,34 @@ +// +// TDSCommonService.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/10. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonService : NSObject + ++ (void)useNativeDataInCore:(NSNumber *)enable; + ++ (void)setDurationStatisticsEnabled:(NSNumber *)enable; + ++ (void)initWithConfig:(NSString*)configJSON versionName:(NSString*)versionName; + ++ (void)setXUA:(NSString*)json; + ++ (void)getRegionCode:(void (^)(NSString *result))callback; + ++ (void)isTapTapInstalled:(void (^)(NSString *result))callback; + ++ (void)isTapGlobalInstalled:(void (^)(NSString *result))callback; + ++ (void)preferredLanguage:(NSNumber *)language; + ++ (void)hostToBeReplaced:(NSString*)host replacedHost:(NSString*) replaceHost; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h.meta new file mode 100644 index 0000000..1654d2e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonService.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0501da4d75d84455a903074c19234336 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h new file mode 100644 index 0000000..c797f6c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h @@ -0,0 +1,70 @@ +// +// TDSCommonUIHelper.h +// TDSCommon +// +// Created by Bottle K on 2021/3/2. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonUIHelper : NSObject + +/// 从common bundle获取image ++ (UIImage *)getImageFromCommonWithImageName:(NSString *)name; + +/// 从bundle获取image ++ (UIImage *)getImageFromBundle:(NSString *)bundleName withImage:(NSString *)imageName; + +/// 从bundle获取翻译后的文案 ++ (NSString *)getTranslatedStringFromCommonWithKey:(NSString *)key; + +/// rgb转color ++ (UIColor *)rgbToColorWithRed:(CGFloat)red + green:(CGFloat)green + blue:(CGFloat)blue; + +/// rgba转color ++ (UIColor *)rgbToColorWithRed:(CGFloat)red + green:(CGFloat)green + blue:(CGFloat)blue + aplha:(CGFloat)alpha; + +/// hex转color ++ (UIColor *)hexToColor:(int)hexValue; + +/// hex转color ++ (UIColor *)hexToColor:(int)hexValue alpha:(CGFloat)alpha; + +/// 屏幕宽度,会根据横竖屏的变化而变化 ++ (CGFloat)screenWidth; + +/// 屏幕高度,会根据横竖屏的变化而变化 ++ (CGFloat)screenHeight; + +/// 屏幕宽度,跟横竖屏无关 ++ (CGFloat)deviceWidth; + +/// 屏幕高度,跟横竖屏无关 ++ (CGFloat)deviceHeight; + +/// 用户界面横屏了才会返回YES ++ (BOOL)isUILandscape; + +/// 无论支不支持横屏,只要设备横屏了,就会返回YES ++ (BOOL)isDeviceLandscape; + +/// 是否有刘海 ++ (BOOL)hasNotch; + +/// 安全区域(上左下右) ++ (UIEdgeInsets)safeAreaInsets; + ++ (UIViewController *)findTopViewController; + ++ (UIViewController *)findUIViewController:(UIViewController *)controller; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h.meta new file mode 100644 index 0000000..bfa788c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUIHelper.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5ffcd50bceef04898b4cfab55b8aac6a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h new file mode 100644 index 0000000..c5a2be6 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h @@ -0,0 +1,47 @@ +// +// TDSCommonUtils.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/18. +// + +#import +#import "TDSTrackerConfig.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSCommonUtils : NSObject ++ (NSData *)lz4Compress:(NSData *)rawData; + ++ (uint32_t)transformTime; + ++ (NSString *)md5HexDigest:(NSData *)data; + ++ (NSString *)getDeviceIdentifier; + ++ (NSString *)getAppVersion; + ++ (NSString *)getAppBuildNumber; + ++ (NSString *)getHardParam; + ++ (NSString *)getNetworkType; + ++ (NSString *)getNetWorkStatus:(NSString *)hostName; + ++ (NSString *)getTotalMemorySize:(unsigned long long)fileSize; + ++ (long long)getTotalDiskSize; + ++ (NSString *)localeIdentifier; + ++ (NSString *)getCpuArchitecture; + ++ (NSString *)topic:(TDSTrackerType)type; + ++ (NSString *)getProcessId; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h.meta new file mode 100644 index 0000000..ddf6dfd --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonUtils.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fa854ae4603ed4f6dac11730bd474a68 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h new file mode 100644 index 0000000..c976c81 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h @@ -0,0 +1,108 @@ +// +// TDSDebounce.h +// TDSCommon +// +// Created by JiangJiahao on 2021/3/22. +// + + +#import + +/** 自定管理执行与释放时,标记调用来源: 对象/类地址_方法名_调用行数 */ +#define TDSDebunceKey [NSString stringWithFormat:@"%p_%s_%d",self,__func__,__LINE__] +#define TDSDebunceKeyAppendCustom(customKey) [NSString stringWithFormat:@"%p_%s_%d%@",self,__func__,__LINE__,customKey] + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^TDSDebounceTaskBlock)(void); +extern double const DEBOUNCE_INTERVAL; // 默认频率间隔,0.5s + +/** + 相邻调用若都在间隔时间内,则合并成一次调用 + */ +@interface TDSDebounce : NSObject +#pragma mark - 自动管理 ++ (TDSDebounce *)debounceWithDebounceKey:(NSString *)debounceKey taskBlock:(TDSDebounceTaskBlock)taskBlock; + ++ (TDSDebounce *)debounceWithInterval:(NSTimeInterval)interval + debounceKey:(NSString *)debounceKey + taskBlock:(TDSDebounceTaskBlock)taskBlock; + +/// 自动执行一个Debounce(防抖)任务。 +/// 注意:适用调用不是异常频繁的任务,如用户按钮频繁点击限制 +/// @param interval 防抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param debounceKey 任务来源标识,可使用默认宏 TDSDebunceKey 或 TDSDebunceKeyAppendCustom +/// @param taskBlock 需要执行的任务 ++ (TDSDebounce *)debounceWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + debounceKey:(NSString *)debounceKey + taskBlock:(TDSDebounceTaskBlock)taskBlock; +#pragma mark - 手动管理 ++ (TDSDebounce *)manualDebounceWithTaskBlock:(TDSDebounceTaskBlock)taskBlock; + ++ (TDSDebounce *)manualDebounceWithInterval:(NSTimeInterval)interval + taskBlock:(TDSDebounceTaskBlock)taskBlock; + +/// 手动获取一个Debounce(防抖)任务,需要在不再使用时手动调用 dispose 释放 +/// 注意:适合在任务会异常频繁执行时进行限制 +/// @param interval 抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param taskBlock 需要执行的任务 ++ (TDSDebounce *)manualDebounceWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + taskBlock:(TDSDebounceTaskBlock)taskBlock; +#pragma mark - 执行与释放 +/// 触发任务执行,手动管理时调用 +- (void)invoke; + +/// 销毁任务,手动管理时调用 +- (void)dispose; + +@end + +#pragma mark - private classes +/** + 调用后等待间隔时间超时以后触发,每次触发后重新计时 + */ +@interface TDSDebounceTrailing : TDSDebounce + +@end + +/** + 调用后立即触发,间隔时间未超时无法再次触发,每次触发后重新计时 + */ +@interface TDSDebounceLeading : TDSDebounce + +@end + +/** + 使用方法: + 1.自动管理(自动执行/释放) + // 按钮事件或需要执行的函数,任务使用 Debounce 包裹 + - (void)testDebounce { + [TDSDebounceLeading debounceWithInterval:0.8 debounceKey:TDSDebunceKey taskBlock:^{ + // TODO 想要执行的任务 + }]; + } + + 2.手动管理 (创建时调用 manual 开头函数) + + @property (nonatomic, strong) TDSDebounce *testDebouncer; + + // 按钮事件或需要执行的函数,任务使用 Debounce 包裹 + - (void)testDebounce { + if (!self.testDebouncer) { + self.testDebouncer = [TDSDebounceLeading manualDebounceWithTaskBlock:^{ + // TODO 想要执行的任务 + }]; + } + [self.testDebouncer invoke]; + } + + // 在适当时机,如退出页面时释放 + [self.testDebouncer dispose]; + */ + +NS_ASSUME_NONNULL_END + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h.meta new file mode 100644 index 0000000..63676da --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDebounce.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8e1242aede84e46cca9358356b32d854 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h new file mode 100644 index 0000000..a1d329f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h @@ -0,0 +1,61 @@ +// +// TDSDomainManager.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSDomainManagerDelegate + +@optional +- (void)checkDomainsDone:(NSDictionary *)resultInfo; + +@end + +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_HOST_KEY; +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_CODE_KEY; +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_DELAY_KEY; +FOUNDATION_EXTERN NSString *const DOMAIN_CHECK_REACHABLE_KEY; + +@interface TDSDomainManager : NSObject +/// 获取一个域名管理实例 +/// @param mainDomains 主域名 +/// @param backupDomains 备用域名 ++ (TDSDomainManager *)managerForDomains:(NSArray *)mainDomains backupDomains:(NSArray *)backupDomains; + +- (void)setupDelegate:(id)delegate; + +/// 指定域名检查接口 +/// @param checkAPI 检查接口 +- (void)setupCheckAPI:(NSString *)checkAPI; + +/// 获取一个当前可用域名 +- (NSString *)getActiveDomain; + +/// 标记一个域名为可用 +/// @param domain 域名 +- (void)activeDomain:(NSString *)domain; ++ (void)activeDomain:(NSString *)domain; + +/// 标记一个域名不可用 +/// @param domain 域名 +- (void)deactiveDomain:(NSString *)domain; ++ (void)deactiveDomain:(NSString *)domain; + +/// 开始检测域名,并定期检测 +- (void)startCheckDomains; + +/// 开始检测域名 +/// @param api 若传入api则会请求该api数据,若传入空则直接检查域名连通 +/// @param repeat 是否定时检测 +- (void)startCheckDomains:(nullable NSString *)api repeat:(BOOL)repeat; + +/// 停止检测域名 +- (void)stopCheckDomains; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h.meta new file mode 100644 index 0000000..5972c5e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSDomainManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7c62d644784fc4d80a4304561383e4b9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h new file mode 100644 index 0000000..1a6dae5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h @@ -0,0 +1,24 @@ +// +// FilePath.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 文件路径类 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSFilePath : NSObject ++ (NSString *)homePath; ++ (NSString *)documentsPath; ++ (NSString *)cachesPath; ++ (NSString *)tmpPath; ++ (NSString *)pathForFile:(NSString *)name type:(NSString *)type; ++ (NSString *)imagePath; + ++ (NSString *)bundlePath; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h.meta new file mode 100644 index 0000000..b12a82c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSFilePath.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bf1ada14880114242b2dd2bdd17d1b4d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHUD.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHUD.h new file mode 100644 index 0000000..46475b4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHUD.h @@ -0,0 +1,34 @@ +// +// TDSHUD.h +// AFNetworking +// +// Created by HarryHuang on 2018/8/29. +// + +#import + +@interface TDSHUD : NSObject + +//在window上显示等待 ++ (void)showWait; ++ (void)showWaitWithString:(NSString *)string; ++ (void)dismiss; + +//在指定的view上显示等待 ++ (void)showWaitOnView:(UIView *)view; ++ (void)showWaitWithString:(NSString *)string onView:(UIView *)view; ++ (void)dismissOnView:(UIView *)view; + +//toast,显示提示语; ++ (void)showString:(NSString *)string; ++ (void)showString:(NSString *)string timeInterval:(NSTimeInterval)timeInterval; ++ (void)showString:(NSString *)string timeInterval:(NSTimeInterval)timeInterval offsetY:(CGFloat)offset; + +//toast,显示提示语和自定义图片; ++ (void)showImageName:(NSString *)imageName string:(NSString *)string; ++ (void)showImage:(UIImage *)image string:(NSString *)string; ++ (void)showImage:(UIImage *)image string:(NSString *)string timeInterval:(NSTimeInterval)timeInterval; ++ (void)showImage:(UIImage *)image string:(NSString *)string timeInterval:(NSTimeInterval)timeInterval offsetY:(CGFloat)offset; + +@end + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHUD.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHUD.h.meta new file mode 100644 index 0000000..d8f0522 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHUD.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cda5815bf964f43929c26d15bd273db0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h new file mode 100644 index 0000000..d87a82e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h @@ -0,0 +1,26 @@ +// +// TDSHandleUrl.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/3/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHandleUrl : NSObject + +/// 在application:openURL:中调用 +/// @param url 传入openURL的url ++ (BOOL)handleOpenURL:(nullable NSURL *)url; + +/// 各模块注册handleUrl的事件 +/// @param event 在block中调用handleUrl的事件 +/// @param tag 唯一标识符,防止重复添加 ++ (void)addHandleEvent:(BOOL (^)(NSURL *url))event withTag:(NSString *)tag; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta new file mode 100644 index 0000000..4c69b96 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e5feb566ade8042ebaf63cdbb5504e0d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h new file mode 100644 index 0000000..15c59e1 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h @@ -0,0 +1,26 @@ +// +// TDSHostReplaceUtil.h +// TapCommonSDK +// +// Created by Bottle K on 2021/8/3. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHostReplaceUtil : NSObject ++ (instancetype)shareInstance; + +- (void)addReplacedHostPair:(NSString *)hostToBeReplaced replacedHost:(NSString *)replacedHost; + +- (void)clearReplacedHostPair:(NSString *)hostToBeReplaced; + +- (void)clear; + +- (NSString *)getReplacedHost:(NSString *)originalHost; + +- (BOOL)isTestMode; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h.meta new file mode 100644 index 0000000..8211f73 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHostReplaceUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6601cb11f7acb489aa410e881b72d18f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h new file mode 100644 index 0000000..121be12 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h @@ -0,0 +1,30 @@ +// +// HttpDownloadBase.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 下载基类 + +#import + +typedef void(^downloadCallback)(BOOL success); + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpDownloadBase : NSObject +/// 下载完成以后文件存储路径 ++ (NSString *)saveFilePath; + +/// 文件存储名 +/// @param url 文件url ++ (NSString *)saveFileName:(NSString *)url; + +/// 下载文件 +/// @param url 文件url +/// @param callback 下载结果回调 ++ (void)downloadFile:(NSString *)url callback:(downloadCallback)callback; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h.meta new file mode 100644 index 0000000..8f34d07 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadBase.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bec2cb8a0d2344f0098c623afb25f8ba +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h new file mode 100644 index 0000000..643c0e5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h @@ -0,0 +1,22 @@ +// +// TDSHttpDownloadFile.h +// TapCommonSDK +// +// Created by SeraphLi on 2022/12/13. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpDownloadFile : TDSHttpDownloadBase + ++ (void)downloadFile:(NSString *)url callback:(downloadCallback)callback; + ++ (void)getFileFromCacheOrNet:(NSString *)url callback:(downloadCallback)callback; + ++ (NSString *) getFullCachePath:(NSString *)url; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h.meta new file mode 100644 index 0000000..d3a0ecf --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadFile.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6a8c68e6f945444ffa6e94482b618014 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h new file mode 100644 index 0000000..8f4571f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h @@ -0,0 +1,19 @@ +// +// HttpDownloadImage.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpDownloadImage : TDSHttpDownloadBase + ++ (void)downloadImage:(NSString *)url callback:(downloadCallback)callback; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h.meta new file mode 100644 index 0000000..0e8a141 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpDownloadImage.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 530ab5a2b033f4ae1a9bda97373fd490 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h new file mode 100644 index 0000000..3afeca3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h @@ -0,0 +1,22 @@ +// +// HttpRequest.h +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// Httpq请求封装 + +#import + +@interface TDSHttpRequest : NSObject + +//! GET参数拼接 ++ (NSString *)connectUrl:(NSString *)url params:(NSDictionary *)params; ++ (NSString *)connectUrl:(NSString *)url params:(NSDictionary *)params encode:(BOOL)encode; + +// POST请求参数拼接 ++ (NSString *)postStringWithParams:(NSDictionary *)params; + +// cookie ++ (NSString *)cookieStringForUrl:(NSString *)url; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h.meta new file mode 100644 index 0000000..b66273b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpRequest.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1c9c67d2c71864e27acad2a3f2052587 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h new file mode 100644 index 0000000..338f736 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h @@ -0,0 +1,23 @@ +// +// HttpResult.h +// +// Created by JiangJiahao on 2018/3/9. +// Copyright © 2018年 JiangJiahao. All rights reserved. +// + +#import + +@interface TDSHttpResult : NSObject + +@property (nonatomic,strong) NSData *data; +@property (nonatomic,strong) NSURLResponse *response; +@property (nonatomic,strong) NSError *error; +@property (nonatomic,strong) NSError *localError; // 本地错误 +@property (nonatomic,copy) NSString *originUrl; + +@property (nonatomic,copy) NSDictionary *resultDic; + +// 多个get同时返回数据时使用 +@property (nonatomic) NSArray *dataArr; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h.meta new file mode 100644 index 0000000..ee1ef9d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpResult.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 722eb013f504144fc85cae417e2aa144 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h new file mode 100644 index 0000000..a18f43d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h @@ -0,0 +1,47 @@ +// +// TTAchievementUtil.h +// TapAchievement +// +// Created by TapTap-David on 2020/9/15. +// Copyright © 2020 taptap. All rights reserved. +// + +#import + + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSHttpUtil : NSObject ++ (NSString *)URLEncodeString:(NSString *)str; + ++ (NSString *)URLDecodeString:(NSString *)str; + ++ (NSString *)urlEncode:(NSString *)str; + ++ (NSString *)SHA256:(NSString *)key; + ++ (NSString *)md5String:(NSString *)str; + ++ (NSString *)getCurrentTime; + ++ (NSString *)randomString:(int)length; + ++ (NSString *)base64HMacSha1WithSecret:(NSString *)secret + signString:(NSString *)signString; + ++ (NSString *)getLcSignWithClientKey:(NSString *)clientKey; + ++ (NSString *)getMacToken:(NSString *)url + method:(NSString *)method + oauthID:(NSString *)oauthID +oauthMacKey:(NSString *)oauthMacKey; + ++ (NSString *)getDeviceId; + ++ (NSString *)createACodeVerifier:(NSUInteger)length; + ++ (NSDictionary *)queryDictionaryFromURL:(NSURL *)url; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h.meta new file mode 100644 index 0000000..2989425 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHttpUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 544a0a2af35b9454e866cae9c00398f6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h new file mode 100644 index 0000000..2f3262d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h @@ -0,0 +1,45 @@ +// +// ImageManager.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 图片辅助类,有些方法可以用catogary实现 + +#import +#import + +typedef void(^resultBlockWithName)(UIImage *_Nullable resultImage,NSString * _Nonnull imageName); +typedef void(^resultBlock)(UIImage *_Nullable resultImage); + + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSImageManager : NSObject +/// 图片缩放 +/// @param img 图片 +/// @param size 尺寸 ++ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size; + +/// 滤镜,高斯模糊 +/// @param image 图片 +/// @param blur 模糊程度 ++ (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur; + +/// URL获取图片名称 +/// @param url 图片URL ++ (NSString *)imageNameWithUrl:(NSString *)url; + ++ (void)loadImage:(NSString *)imageName needDecode:(BOOL)needDecode resultBlock:(resultBlockWithName)block; ++ (void)loadImage:(NSString *)imageName resultBlock:(resultBlockWithName)block; ++ (void)loadImage:(NSString *)imageName size:(CGSize)size resultBlock:(resultBlockWithName)block; + +// 只需要传入"xxx.png" ++ (UIImage *)getBundleImage:(NSString *)imageName resultBlock:(resultBlockWithName)block; ++ (UIImage *)getBundleImage:(NSString *)imageName size:(CGSize)size resultBlock:(resultBlockWithName)block; + +//UIColor 转UIImage ++ (UIImage*)createImageWithColor: (UIColor *)color; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h.meta new file mode 100644 index 0000000..14f3128 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 77498ccfe56854c5ba0b9b2ebaaca033 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h new file mode 100644 index 0000000..e5fd85f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h @@ -0,0 +1,28 @@ +// +// TDSLabel.h +// XdComPlatform +// +// Created by JiangJiahao on 2020/5/14. +// Copyright © 2020 X.D. Network Inc. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^CopySuccessCallback)(void); + +typedef NS_ENUM(NSInteger,TDSLabelVerticalAlignment) { + TDSLabelVerticalAlignmentTop = 0, + TDSLabelVerticalAlignmentCenter, + TDSLabelVerticalAlignmentBottom, +}; + +@interface TDSLabel : UILabel +@property (nonatomic) UIEdgeInsets edgeInsets; +@property (nonatomic) BOOL canCopy; +@property (nonatomic) CopySuccessCallback copyCallback; +@property (nonatomic) TDSLabelVerticalAlignment verticalAlignment; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta new file mode 100644 index 0000000..984ed02 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5b5f3ca57dd0d45acb14d21faca50154 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h new file mode 100644 index 0000000..a945d59 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h @@ -0,0 +1,20 @@ +// +// XDLightWebImageView.h +// NativeApp +// +// Created by JiangJiahao on 2018/12/18. +// Copyright © 2018 JiangJiahao. All rights reserved. +// 轻量,没有点击事件 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSLightWebImageView : UIView + +- (void)setImageWithUrl:(NSString *)imageUrl; +- (void)setImageWithUrl:(NSString *)imageUrl size:(CGSize)imageSize; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h.meta new file mode 100644 index 0000000..d7036c0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLightWebImageView.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8d31d69ad6fd44c40ae7e62f6bf8a2ec +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h new file mode 100644 index 0000000..447a2e7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h @@ -0,0 +1,58 @@ +// +// TDSLocalizeManager.h +// TDSCommon +// +// Created by Bottle K on 2021/3/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSInteger, TapLanguageType) { + TapLanguageType_Auto = 0,// 自动 + TapLanguageType_zh_Hans,// 简体中文 + TapLanguageType_en,// 英文 + TapLanguageType_zh_Hant,// 繁体中文 + TapLanguageType_ja,// 日文 + TapLanguageType_ko,// 韩文 + TapLanguageType_th,// 泰文 + TapLanguageType_id,// 印度尼西亚语 + TapLanguageType_de,// 德语 + TapLanguageType_es,// 西班牙语 + TapLanguageType_fr,// 法语 + TapLanguageType_pt,// 葡萄牙语 + TapLanguageType_ru,// 俄罗斯语 + TapLanguageType_tr,// 土耳其语 + TapLanguageType_vi,// 越南语 +}; + +@interface TDSLocalizeManager : NSObject + +@property (nonatomic, assign) BOOL regionIsIO; + ++ (instancetype)shareInstance; + +/// 设定当前语言类型 +/// @param langType 语言类型 ++ (void)setCurrentLanguage:(TapLanguageType)langType; + +/// 获取当前语言类型 ++ (TapLanguageType)currentLanguage; + +/// 获取当前语言的 String ++ (NSString *)getCurrentLangString; + +/// 注册SDK本地化翻译 +/// @param sdk SDK tag +/// @param filePath 本地化翻译文件位置 ++ (void)addSDKLocalization:(NSString *)sdk localizedFilePath:(NSString *)filePath; + +/// 获取本地化翻译 +/// @param sdk SDK tag +/// @param key 本地化翻译key ++ (NSString *)getLocalizedStringWithSDK:(NSString *)sdk localizedKey:(NSString *)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h.meta new file mode 100644 index 0000000..27e0141 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f56daae10c3ce45c3bac0eacda2f98f2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h new file mode 100644 index 0000000..82dc716 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h @@ -0,0 +1,18 @@ +// +// TDSLocalizeUtil.h +// TapCommonSDK +// +// Created by Bottle K on 2021/3/4. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSLocalizeUtil : NSObject ++ (NSString *)getCurrentLangString; ++ (TapLanguageType)getCurrentLangType; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h.meta new file mode 100644 index 0000000..6c39e48 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLocalizeUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3aaa081880f5e401896f3a6ff0f7741f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h new file mode 100644 index 0000000..e965e11 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h @@ -0,0 +1,53 @@ +// +// TDSLog.h +// TDSCommon +// +// Created by Insomnia on 2020/10/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +#ifndef TDSLogInfo +#define TDSLogInfo(model, format, ...) TDSLogInfoFunc(model, [NSString stringWithFormat:format, ## __VA_ARGS__], __PRETTY_FUNCTION__) +#endif + +#ifndef TDSLogCustom +#define TDSLogCustom(model, tag, format, ...) TDSLogCustomFunc(model, tag, [NSString stringWithFormat:format, ## __VA_ARGS__], __PRETTY_FUNCTION__) +#endif + +#ifndef TDSLogCrash +#define TDSLogCrash(model, format, ...) TDSLogCustomFunc(model, @"Crash", [NSString stringWithFormat:format, ## __VA_ARGS__], __PRETTY_FUNCTION__) +#endif + +@interface TDSLogModel : NSObject +@property (nonatomic, copy, nonnull) NSString *sdkName; +@property (nonatomic, copy, nonnull) NSString *sdkCode; +@property (nonatomic, copy, nonnull) NSString *sdkVersion; +@end + +@protocol TDSLogDelegate +@optional +- (void)reciveLogWithModel:(TDSLogModel * _Nullable)model tag:(NSString * _Nullable)tag content:(id)content; +@end + +@interface TDSLog : NSObject + +@property (nonatomic, weak) id delegate; + ++ (instancetype)sharedInstance; + +- (void)tdsLogWithModel:(TDSLogModel * _Nonnull)model tag:(NSString *)tag content:(NSString *)content; + + + +@end + + +/** 记录Info标签日志 */ +FOUNDATION_EXPORT void TDSLogInfoFunc(TDSLogModel* _Nonnull model, NSString* _Nonnull log, const char * func); +/** 记录自定义标签日志 */ +FOUNDATION_EXPORT void TDSLogCustomFunc(TDSLogModel* _Nonnull model, NSString *_Nonnull tag, NSString* _Nonnull log,const char * func); + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h.meta new file mode 100644 index 0000000..ae462ca --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLog.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6a432b85af2e4c8e8866038a9d4302f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h new file mode 100644 index 0000000..2d38930 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h @@ -0,0 +1,17 @@ +// +// TDSLoggerService.h +// TDSCommon +// +// Created by Insomnia on 2020/10/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSLoggerService : NSObject + ++ (void)log:(NSString *)config tag:(NSString *)tag message:(NSString *)message; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h.meta new file mode 100644 index 0000000..f6ce49f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLoggerService.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 81c63acc51f3d460c8ee2470fa4dbea6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h new file mode 100644 index 0000000..83b56d8 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h @@ -0,0 +1,63 @@ +// +// TDSMacros.h +// TDSCommon +// +// Created by Insomnia on 2020/10/19. +// + +#import +#import + +#ifndef TDS_LOCK +#define TDS_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); +#endif + +#ifndef TDS_UNLOCK +#define TDS_UNLOCK(lock) dispatch_semaphore_signal(lock); +#endif + +#define TDSSemaphoreCreate \ +static dispatch_semaphore_t signalSemaphore; \ +static dispatch_once_t onceTokenSemaphore; \ +dispatch_once(&onceTokenSemaphore, ^{ \ + signalSemaphore = dispatch_semaphore_create(1); \ +}); + +#define TDSSemaphoreWait TDS_LOCK(signalSemaphore) +#define TDSSemaphoreSignal TDS_UNLOCK(signalSemaphore) + +#ifndef weakify +#define weakify(...) \ +tds_keywordify \ +metamacro_foreach_cxt(tds_weakify_,, __weak, __VA_ARGS__) +#endif + +#ifndef strongify +#define strongify(...) \ +tds_keywordify \ +_Pragma("clang diagnostic push") \ +_Pragma("clang diagnostic ignored \"-Wshadow\"") \ +metamacro_foreach(tds_strongify_,, __VA_ARGS__) \ +_Pragma("clang diagnostic pop") +#endif + +#define tds_weakify_(INDEX, CONTEXT, VAR) \ +CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); + +#define tds_strongify_(INDEX, VAR) \ +__strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); + +#if DEBUG +#define tds_keywordify autoreleasepool {} +#else +#define tds_keywordify try {} @catch (...) {} +#endif + +#ifndef dispatch_main_async_safe +#define dispatch_main_async_safe(block)\ + if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(dispatch_get_main_queue())) {\ + block();\ + } else {\ + dispatch_async(dispatch_get_main_queue(), block);\ + } +#endif diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h.meta new file mode 100644 index 0000000..a3c33a4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMacros.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4e4ba17d059a14d469ec1d8a2f7df61b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h new file mode 100644 index 0000000..814ac0c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h @@ -0,0 +1,31 @@ +// +// XDCache.h +// XDCollectionView +// +// Created by JiangJiahao on 2019/5/22. +// Copyright © 2019 tapdb. All rights reserved. +// simple image cache + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSMemoryCache : NSObject ++ (TDSMemoryCache *)shareInstance; + +/// 设置最大缓存数量,默认50 +/// @param countLimit 缓存数量 ++ (void)setCacheCountLimit:(NSUInteger)countLimit; + +/// 设置缓存项目 +/// @param obj 缓存对象 +/// @param key key ++ (void)setObject:(id)obj forKey:(id)key; + +/// 获取缓存 +/// @param key Key ++ (id)objectForKey:(id)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h.meta new file mode 100644 index 0000000..a83a5ed --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSMemoryCache.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ebff5e9f36dd49818bc0e91116b11e8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h new file mode 100644 index 0000000..337ea5d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h @@ -0,0 +1,91 @@ +// +// TDSModelHelper.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import + +#ifndef __TDSConst__ +#define __TDSConst__ +extern NSString *const TDSTypeInt; +extern NSString *const TDSTypeFloat; +extern NSString *const TDSTypeDouble; +extern NSString *const TDSTypeLong; +extern NSString *const TDSTypeLongLong; +extern NSString *const TDSTypeChar; +extern NSString *const TDSTypeBOOL; +extern NSString *const TDSTypePointer; + +extern NSString *const TDSTypeIvar; +extern NSString *const TDSTypeMethod; +extern NSString *const TDSTypeBlock; +extern NSString *const TDSTypeClass; +extern NSString *const TDSTypeSEL; +extern NSString *const TDSTypeId; + +#endif + + + +@interface TDSPropertyType : NSObject +/** 类型标识符 */ +@property (nonatomic, copy) NSString *code; + +/** 是否为id类型 */ +@property (nonatomic, readonly, getter=isIdType) BOOL idType; + +/** 对象类型(如果是基本数据类型,此值为nil) */ +@property (nonatomic, readonly) Class typeClass; + +/** 类型是否来自于Foundation框架,比如NSString、NSArray */ +@property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; +/** 类型是否不支持KVC */ +@property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; + +/** + * 获得缓存的类型对象 + */ ++ (instancetype)cachedTypeWithCode:(NSString *)code; +@end + +@interface TDSProperty : NSObject +/** 成员属性 */ +@property (nonatomic, assign) objc_property_t property; +/** 成员属性名 */ +@property (nonatomic, readonly) NSString *name; + +/** 成员变量的类型 */ +@property (nonatomic, readonly) TDSPropertyType *type; +/** 成员来源于哪个类(可能是父类) */ +@property (nonatomic, assign) Class srcClass; + +/**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ +/** 对应着字典中的key */ +- (void)setKey:(NSString *)key forClass:(Class)c; +- (NSString *)keyFromClass:(Class)c; + +/** 对应着字典中的多级key */ +- (NSArray *)keysFromClass:(Class)c; + +/** 模型数组中的模型类型 */ +- (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; +- (Class)objectClassInArrayFromClass:(Class)c; +/**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ + +/** + * 设置成员变量的值 + */ +- (void)setValue:(id)value forObject:(id)object; +/** + * 得到成员变量的值 + */ +- (id)valueFromObject:(id)object; + +/** + * 初始化 + */ ++ (instancetype)cachedPropertyWithProperty:(objc_property_t)property; +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta new file mode 100644 index 0000000..586e465 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0ffdbb8537750490298f81b0b8e7126f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h new file mode 100644 index 0000000..0ece75e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h @@ -0,0 +1,35 @@ +// +// TDSNetClient.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import +#import + +// 待定 +typedef void (^TDSNetProgressBlock) (NSProgress *_Nonnull downloadProgress); +// 返回值待定 +typedef void (^TDSNetSuccessBlock) (NSDictionary *_Nullable resultDic); +// 返回值待定 +typedef void (^TDSNetFailureBlock) (NSError *_Nonnull error); + + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetClient : NSObject + +// success / failure 传递data中内容 +- (instancetype)initWithConfig:(TDSNetConfigModel *)config; + +- (void)requestWithModel:(TDSNetRequestModel *)model success:(TDSNetSuccessBlock)success; + +- (void)requestWithModel:(TDSNetRequestModel *)model success:(TDSNetSuccessBlock)success failure:(nullable TDSNetFailureBlock)failure; + +- (void)requestWithModel:(TDSNetRequestModel *)model success:(TDSNetSuccessBlock)success failure:(nullable TDSNetFailureBlock)failure progress:(nullable TDSNetProgressBlock)progress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h.meta new file mode 100644 index 0000000..b20e1e4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClient.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a915277cc2e741eb8c33687f300d7f1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h new file mode 100644 index 0000000..cc5901e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h @@ -0,0 +1,22 @@ +// +// TDSNetClientConfig.h +// TDSCommon +// +// Created by Insomnia on 2020/10/20. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetConfigModel : NSObject +/// 可扩展头 +@property (nonatomic, copy, nullable) NSString *baseUrl; +@property (nonatomic, copy, nullable) NSDictionary *extensionHeader; +@property (nonatomic, strong, nullable) TDSCommonHeader *commonHeader; +@property (nonatomic, strong, nullable) TDSAccount *account; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h.meta new file mode 100644 index 0000000..377bfcc --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetClientModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 453b363ce22184173b1e81b3cbdd09da +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h new file mode 100644 index 0000000..3de213c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h @@ -0,0 +1,51 @@ +// +// TDSNetExecutor.h +// TDSCommon +// +// Created by Insomnia on 2020/10/21. +// + +#import +#import + +typedef NS_ENUM (NSUInteger, TDSNetMethod) { + TDSNetMethodGet = 1, + TDSNetMethodPost +}; + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetRequestModel : NSObject + +@property (nonatomic, assign) TDSNetMethod method; + +@property (nonatomic, copy) NSString *url; + +@property (nonatomic, strong) id args; + +@property (nonatomic, strong) NSData *data; //protobuf Data数据 + +@property (nonatomic, assign) BOOL auth; + +@property (nonatomic) Class resCls; + +@property (nonatomic, copy, nullable) NSDictionary *header; + +//是否使用原始网络返回结果 +@property (nonatomic, assign) BOOL useOriginResponse; + +@end + +@interface TDSNetExecutor<__covariant T>: NSObject + ++ (TDSNetExecutor *)create:(void(NS_NOESCAPE ^)(id subscriber))didSubscribe; + +- (void)success:(void(NS_NOESCAPE ^)(id _Nonnull x))success; + +- (void)success:(void(NS_NOESCAPE ^)(id _Nonnull x))success failure:(void (^)(NSError *error))failure; + +- (void)success:(void(NS_NOESCAPE ^)(id _Nonnull x))success failure:(void (^)(NSError *error))failure progress:(void(NS_NOESCAPE ^)(id progress))progress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h.meta new file mode 100644 index 0000000..8dc8455 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetExecutor.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0f3b057222aea4b17980a644683d73f9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h new file mode 100644 index 0000000..3691c9f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h @@ -0,0 +1,36 @@ +// +// TDSNetInterceptor.h +// TDSCommon +// +// Created by Bottle K on 2021/2/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol TDSNetInterceptDelegate +@optional +- (void)receiveNetContent:(NSDictionary *)content; +@end + +@interface TDSNetInterceptor : NSObject + ++ (instancetype)new NS_UNAVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; + ++ (instancetype)sharedInstance; + +- (void)registerNetInterceptor:(NSString *)from delegate:(id)delegate; + +- (void)unRegisterNetInterceptor:(NSString *)from; + +- (void)interceptWithContent:(NSDictionary *)content; + ++ (void)checkAuthErrorAccessDenied:(NSDictionary *)params handler:(void (^)(NSDictionary *dataDic))handler; + ++ (void)checkAuthError:(NSDictionary *)params errorList:(NSArray *)errorList handler:(void (^)(NSDictionary *dataDic))handler; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h.meta new file mode 100644 index 0000000..8c771a9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetInterceptor.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 65b010d1f84174555adf0ef0a8271492 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h new file mode 100644 index 0000000..b7fb84f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h @@ -0,0 +1,29 @@ +// +// TDSNetSubscriber.h +// TDSCommon +// +// Created by Insomnia on 2020/10/22. +// + +#import + +@protocol TDSNetSubscriber +@optional + +- (void)sendSuccess:(nullable id)value; + +- (void)sendFailure:(nullable NSError *)error; + +- (void)sendProgress:(nullable id)progress; + +@end + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetSubscriber : NSObject + ++ (instancetype)subscriberWithSuccess:(void (^)(id x))success failure:(nullable void (^)(NSError *error))error progress:(nullable void (^)(id progress))progress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h.meta new file mode 100644 index 0000000..416e355 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetSubscriber.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c9e4b762942344a0aac01ee89a9c4d9b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h new file mode 100644 index 0000000..751d7f1 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h @@ -0,0 +1,18 @@ +// +// TDSNetworkTypeUtil.h +// TapCommonSDK +// +// Created by Bottle K on 2021/9/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSNetworkTypeUtil : NSObject ++ (instancetype)shareInstance; +- (NSString *)getMobileType; +- (NSInteger)getNetworkType; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h.meta new file mode 100644 index 0000000..c6685a4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSNetworkTypeUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 71af43fc717f54d02a20a9a393b367e6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h new file mode 100644 index 0000000..310ed61 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h @@ -0,0 +1,391 @@ +// TDSProgressHUD + +#import +#import +#import + +@class TDSBackgroundView; +@protocol TDSProgressHUDDelegate; + + +extern CGFloat const TDSProgressMaxOffset; + +typedef NS_ENUM(NSInteger, TDSProgressHUDMode) { + /// UIActivityIndicatorView. + TDSProgressHUDModeIndeterminate, + /// A round, pie-chart like, progress view. + TDSProgressHUDModeDeterminate, + /// Horizontal progress bar. + TDSProgressHUDModeDeterminateHorizontalBar, + /// Ring-shaped progress view. + TDSProgressHUDModeAnnularDeterminate, + /// Shows a custom view. + TDSProgressHUDModeCustomView, + /// Shows only labels. + TDSProgressHUDModeText +}; + +typedef NS_ENUM(NSInteger, TDSProgressHUDAnimation) { + /// Opacity animation + TDSProgressHUDAnimationFade, + /// Opacity + scale animation (zoom in when appearing zoom out when disappearing) + TDSProgressHUDAnimationZoom, + /// Opacity + scale animation (zoom out style) + TDSProgressHUDAnimationZoomOut, + /// Opacity + scale animation (zoom in style) + TDSProgressHUDAnimationZoomIn +}; + +typedef NS_ENUM(NSInteger, TDSProgressHUDBackgroundStyle) { + /// Solid color background + TDSProgressHUDBackgroundStyleSolidColor, + /// UIVisualEffectView or UIToolbar.layer background view + TDSProgressHUDBackgroundStyleBlur +}; + +typedef void (^TDSProgressHUDCompletionBlock)(void); + + +NS_ASSUME_NONNULL_BEGIN + + +/** + * Displays a simple HUD window containing a progress indicator and two optional labels for short messages. + * + * This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class. + * The XDGProgressHUD window spans over the entire space given to it by the initWithFrame: constructor and catches all + * user input on this region, thereby preventing the user operations on components below the view. + * + * @note To still allow touches to pass through the HUD, you can set hud.userInteractionEnabled = NO. + * @attention XDGProgressHUD is a UI class and should therefore only be accessed on the main thread. + */ +@interface TDSProgressHUD : UIView + +/** + * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:. + * + * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden. + * + * @param view The view that the HUD will be added to + * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use + * animations while appearing. + * @return A reference to the created HUD. + * + * @see hideHUDForView:animated: + * @see animationType + */ ++ (instancetype)showHUDAddedTo:(UIView *)view animated:(BOOL)animated; + +/// @name Showing and hiding + +/** + * Finds the top-most HUD subview that hasn't finished and hides it. The counterpart to this method is showHUDAddedTo:animated:. + * + * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden. + * + * @param view The view that is going to be searched for a HUD subview. + * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use + * animations while disappearing. + * @return YES if a HUD was found and removed, NO otherwise. + * + * @see showHUDAddedTo:animated: + * @see animationType + */ ++ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated; + +/** + * Finds the top-most HUD subview that hasn't finished and returns it. + * + * @param view The view that is going to be searched. + * @return A reference to the last HUD subview discovered. + */ ++ (nullable TDSProgressHUD *)HUDForView:(UIView *)view NS_SWIFT_NAME(forView(_:)); + +/** + * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with + * view.bounds as the parameter. + * + * @param view The view instance that will provide the bounds for the HUD. Should be the same instance as + * the HUD's superview (i.e., the view that the HUD will be added to). + */ +- (instancetype)initWithView:(UIView *)view; + +/** + * Displays the HUD. + * + * @note You need to make sure that the main thread completes its run loop soon after this method call so that + * the user interface can be updated. Call this method when your task is already set up to be executed in a new thread + * (e.g., when using something like NSOperation or making an asynchronous call like NSURLRequest). + * + * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use + * animations while appearing. + * + * @see animationType + */ +- (void)showAnimated:(BOOL)animated; + +/** + * Hides the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to + * hide the HUD when your task completes. + * + * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use + * animations while disappearing. + * + * @see animationType + */ +- (void)hideAnimated:(BOOL)animated; + +/** + * Hides the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to + * hide the HUD when your task completes. + * + * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use + * animations while disappearing. + * @param delay Delay in seconds until the HUD is hidden. + * + * @see animationType + */ +- (void)hideAnimated:(BOOL)animated afterDelay:(NSTimeInterval)delay; + +/** + * The HUD delegate object. Receives HUD state notifications. + */ +@property (weak, nonatomic) id delegate; + +/** + * Called after the HUD is hidden. + */ +@property (copy, nullable) TDSProgressHUDCompletionBlock completionBlock; + +/** + * Grace period is the time (in seconds) that the invoked method may be run without + * showing the HUD. If the task finishes before the grace time runs out, the HUD will + * not be shown at all. + * This may be used to prevent HUD display for very short tasks. + * Defaults to 0 (no grace time). + * @note The graceTime needs to be set before the hud is shown. You thus can't use `showHUDAddedTo:animated:`, + * but instead need to alloc / init the HUD, configure the grace time and than show it manually. + */ +@property (assign, nonatomic) NSTimeInterval graceTime; + +/** + * The minimum time (in seconds) that the HUD is shown. + * This avoids the problem of the HUD being shown and than instantly hidden. + * Defaults to 0 (no minimum show time). + */ +@property (assign, nonatomic) NSTimeInterval minShowTime; + +/** + * Removes the HUD from its parent view when hidden. + * Defaults to NO. + */ +@property (assign, nonatomic) BOOL removeFromSuperViewOnHide; + +/// @name Appearance + +/** + * XDGProgressHUD operation mode. The default is TDSProgressHUDModeIndeterminate. + */ +@property (assign, nonatomic) TDSProgressHUDMode mode; + +/** + * A color that gets forwarded to all labels and supported indicators. Also sets the tintColor + * for custom views on iOS 7+. Set to nil to manage color individually. + * Defaults to semi-translucent black on iOS 7 and later and white on earlier iOS versions. + */ +@property (strong, nonatomic, nullable) UIColor *contentColor UI_APPEARANCE_SELECTOR; + +/** + * The animation type that should be used when the HUD is shown and hidden. + */ +@property (assign, nonatomic) TDSProgressHUDAnimation animationType UI_APPEARANCE_SELECTOR; + +/** + * The bezel offset relative to the center of the view. You can use TDSProgressMaxOffset + * and -TDSProgressMaxOffset to move the HUD all the way to the screen edge in each direction. + * E.g., CGPointMake(0.f, TDSProgressMaxOffset) would position the HUD centered on the bottom edge. + */ +@property (assign, nonatomic) CGPoint offset UI_APPEARANCE_SELECTOR; + +/** + * The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views). + * This also represents the minimum bezel distance to the edge of the HUD view. + * Defaults to 20.f + */ +@property (assign, nonatomic) CGFloat margin UI_APPEARANCE_SELECTOR; + +/** + Defaults to 13.f +*/ +@property (assign, nonatomic) CGFloat verticalMargin UI_APPEARANCE_SELECTOR; + + +/** + * The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size). + */ +@property (assign, nonatomic) CGSize minSize UI_APPEARANCE_SELECTOR; + +/** + * Force the HUD dimensions to be equal if possible. + */ +@property (assign, nonatomic, getter = isSquare) BOOL square UI_APPEARANCE_SELECTOR; + +/** + * When enabled, the bezel center gets slightly affected by the device accelerometer data. + * Defaults to NO. + * + * @note This can cause main thread checker assertions on certain devices. https://github.com/jdg/XDGProgressHUD/issues/552 + */ +@property (assign, nonatomic, getter=areDefaultMotionEffectsEnabled) BOOL defaultMotionEffectsEnabled UI_APPEARANCE_SELECTOR; + +/// @name Progress + +/** + * The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0. + */ +@property (assign, nonatomic) float progress; + +/// @name ProgressObject + +/** + * The NSProgress object feeding the progress information to the progress indicator. + */ +@property (strong, nonatomic, nullable) NSProgress *progressObject; + +/// @name Views + +/** + * The view containing the labels and indicator (or customView). + */ +@property (strong, nonatomic, readonly)TDSBackgroundView *bezelView; + +/** + * View covering the entire HUD area, placed behind bezelView. + */ +@property (strong, nonatomic, readonly)TDSBackgroundView *backgroundView; + +/** + * The UIView (e.g., a UIImageView) to be shown when the HUD is in TDSProgressHUDModeCustomView. + * The view should implement intrinsicContentSize for proper sizing. For best results use approximately 37 by 37 pixels. + */ +@property (strong, nonatomic, nullable) UIView *customView; + +/** + * A label that holds an optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit + * the entire text. + */ +@property (strong, nonatomic, readonly) UILabel *label; + +/** + * A label that holds an optional details message displayed below the labelText message. The details text can span multiple lines. + */ +@property (strong, nonatomic, readonly) UILabel *detailsLabel; + +/** + * A button that is placed below the labels. Visible only if a target / action is added and a title is assigned.. + */ +@property (strong, nonatomic, readonly) UIButton *button; + +@end + + +@protocol TDSProgressHUDDelegate + +@optional + +/** + * Called after the HUD was fully hidden from the screen. + */ +- (void)hudWasHidden:(TDSProgressHUD *)hud; + +@end + + +/** + * A progress view for showing definite progress by filling up a circle (pie chart). + */ +@interface XDGRoundProgressView : UIView + +/** + * Progress (0.0 to 1.0) + */ +@property (nonatomic, assign) float progress; + +/** + * Indicator progress color. + * Defaults to white [UIColor whiteColor]. + */ +@property (nonatomic, strong) UIColor *progressTintColor; + +/** + * Indicator background (non-progress) color. + * Only applicable on iOS versions older than iOS 7. + * Defaults to translucent white (alpha 0.1). + */ +@property (nonatomic, strong) UIColor *backgroundTintColor; + +/* + * Display mode - NO = round or YES = annular. Defaults to round. + */ +@property (nonatomic, assign, getter = isAnnular) BOOL annular; + +@end + + +/** + * A flat bar progress view. + */ +@interface XDGBarProgressView : UIView + +/** + * Progress (0.0 to 1.0) + */ +@property (nonatomic, assign) float progress; + +/** + * Bar border line color. + * Defaults to white [UIColor whiteColor]. + */ +@property (nonatomic, strong) UIColor *lineColor; + +/** + * Bar background color. + * Defaults to clear [UIColor clearColor]; + */ +@property (nonatomic, strong) UIColor *progressRemainingColor; + +/** + * Bar progress color. + * Defaults to white [UIColor whiteColor]. + */ +@property (nonatomic, strong) UIColor *progressColor; + +@end + + +@interface TDSBackgroundView : UIView + +/** + * The background style. + * Defaults to TDSProgressHUDBackgroundStyleBlur. + */ +@property (nonatomic) TDSProgressHUDBackgroundStyle style; + +/** + * The blur effect style, when using TDSProgressHUDBackgroundStyleBlur. + * Defaults to UIBlurEffectStyleLight. + */ +@property (nonatomic) UIBlurEffectStyle blurEffectStyle; + +/** + * The background color or the blur tint color. + * + * Defaults to nil on iOS 13 and later and + * `[UIColor colorWithWhite:0.8f alpha:0.6f]` + * on older systems. + */ +@property (nonatomic, strong, nullable) UIColor *color; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h.meta new file mode 100644 index 0000000..e1503f3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSProgressHUD.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3c7f630ae0f8540e89bffda7edc6d305 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h new file mode 100644 index 0000000..4791689 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h @@ -0,0 +1,52 @@ +// +// XDReachability.h +// TDS +// +// Created by JiangJiahao on 2019/7/25. +// Copyright © 2019 X.D. Network Inc. All rights reserved. +// 直接用的YYReachability + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, TDSReachabilityStatus) { + TDSReachabilityStatusNone = 0, ///< Not Reachable + TDSReachabilityStatusWWAN = 1, ///< Reachable via WWAN (2G/3G/4G) + TDSReachabilityStatusWiFi = 2, ///< Reachable via WiFi +}; + +typedef NS_ENUM(NSUInteger, TDSReachabilityWWANStatus) { + TDSReachabilityWWANStatusNone = 0, ///< Not Reachable vis WWAN + TDSReachabilityWWANStatus2G = 2, ///< Reachable via 2G (GPRS/EDGE) 10~100Kbps + TDSReachabilityWWANStatus3G = 3, ///< Reachable via 3G (WCDMA/HSDPA/...) 1~10Mbps + TDSReachabilityWWANStatus4G = 4, ///< Reachable via 4G (eHRPD/LTE) 100Mbps + TDSReachabilityWWANStatus5G = 5, ///< Reachable via 5G (sa/nsa) 500Mbps +}; + +@interface TDSReachability : NSObject +@property (nonatomic, readonly) SCNetworkReachabilityFlags flags; ///< Current flags. +@property (nonatomic, readonly) TDSReachabilityStatus status; ///< Current status. +@property (nonatomic, readonly) TDSReachabilityWWANStatus wwanStatus NS_AVAILABLE_IOS(7_0); ///< Current WWAN status. +@property (nonatomic, readonly, getter=isReachable) BOOL reachable; ///< Current reachable status. + +/// Notify block which will be called on main thread when network changed. +@property (nullable, nonatomic, copy) void (^TDSReachabilityNotifyBlock)(TDSReachability *reachability); + +/// Create an object to check the reachability of the default route. ++ (instancetype)reachability; + +/// Create an object to check the reachability of the local WI-FI. ++ (instancetype)reachabilityForLocalWifi DEPRECATED_MSG_ATTRIBUTE("unnecessary and potentially harmful"); + +/// Create an object to check the reachability of a given host name. ++ (nullable instancetype)reachabilityWithHostname:(NSString *)hostname; + +/// Create an object to check the reachability of a given IP address +/// @param hostAddress You may pass `struct sockaddr_in` for IPv4 address or `struct sockaddr_in6` for IPv6 address. ++ (nullable instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta new file mode 100644 index 0000000..da6d83b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ffaf16e6115c44d2b9f58b32e604172e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h new file mode 100644 index 0000000..34c8e53 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h @@ -0,0 +1,16 @@ +// +// TDSRegionApi.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/18. +// + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface TDSRegionApi : NSObject ++ (TDSNetExecutor *)getDeviceRegion:(NSInteger)carrier bundleId:(NSString *)bundleId; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h.meta new file mode 100644 index 0000000..9a287b0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionApi.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c37e406cd81b7436389d48145771023a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h new file mode 100644 index 0000000..5bf6225 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h @@ -0,0 +1,18 @@ +// +// TDSRegionHelper.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSRegionHelper : NSObject + ++ (void)getRegionCode:(void(^)(BOOL isMainland))complete; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h.meta new file mode 100644 index 0000000..e262e80 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionHelper.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b0485596b7348481b823e8b40ccb5395 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h new file mode 100644 index 0000000..47b1436 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h @@ -0,0 +1,18 @@ +// +// TDSRegionNetClient.h +// TDSCommon +// +// Created by TapTap-David on 2020/11/18. +// + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface TDSRegionNetClient : NSObject ++ (instancetype)sharedInstance; + +- (TDSNetExecutor *)doWithRequest:(TDSNetRequestModel *)request; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h.meta new file mode 100644 index 0000000..11bb2d7 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRegionNetClient.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 34237e06074db411c9c2d08e56df65e4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h new file mode 100644 index 0000000..95d1462 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h @@ -0,0 +1,37 @@ +// +// Result.h +// EngineBridge +// +// Created by xe on 2020/9/28. +// Copyright © 2020 xe. All rights reserved. +// + + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSResult : NSObject + +@property (nonatomic,assign) int code; +@property (nonatomic,copy) NSString* message; +@property (nonatomic,copy) NSString* content; +@property (nonatomic,copy) NSString* callbackId; +@property (nonatomic,assign) BOOL onceTime; + ++ (TDSResult*)code:(int)code + content:(NSString*)content + callbackId:(NSString*)callbackId + message:(NSString*)message; + ++ (TDSResult*)code:(int)code + content:(NSString*)content + callbackId:(NSString*)callbackId + message:(NSString*)message + onceTime:(BOOL) onceTime; + +- (NSString*)toJSON; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h.meta new file mode 100644 index 0000000..9979945 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSResult.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9de3b4b35fa8c49feb8b8c919be2e113 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h new file mode 100644 index 0000000..38aa638 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h @@ -0,0 +1,63 @@ +// +// TDSRouter.h +// TDSCommon +// +// Created by Insomnia on 2020/11/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const TDSRouterURL; +extern NSString *const TDSRouterResp; +extern NSString *const TDSRouterParams; + +typedef void (^TDSRouterHandler)(NSDictionary *params); + +typedef void (^TDSRouterResponse)(NSDictionary *response); + + +/// TDS路由 +@interface TDSRouter : NSObject + +/// 注册路由 +/// @param url 路由路径,例如tds://service,并支持带参数路由tds://service/:user/:age +/// @param handler 接收参数,包含了注册的 URL 中对应的变量, 如注册的 URL 为ds://service/:user那么,就会传一个 @{@"user": "tds_name"} 这样的字典过来 ++ (void)registerServiceWithURL:(NSString *)url handler:(TDSRouterHandler)handler; + + +/// 反注册 +/// @param url 路由路径 ++ (void)unregisterServiceWithUrl:(NSString *)url; + +/// 请求路由 +/// @param url 路由路径 ++ (void)requestWithURL:(NSString *)url; + + +/// 请求路由 +/// @param url 路由路径 +/// @param params 请求参数 ++ (void)requestWithURL:(NSString *)url params:(NSDictionary * _Nullable)params; + +/// 请求路由 +/// @param url 路由路径 +/// @param params 请求参数 +/// @param response 返回值字典 ++ (void)requestWithURL:(NSString *)url params:(NSDictionary * _Nullable)params response:(TDSRouterResponse _Nullable)response; + +/// 是否存在服务 +/// @param url 路由路径 ++ (BOOL)hasServiceWithURL:(NSString *)url; + + +/// 自动拼接路由参数 +/// @param url 路由路径,例如tds://service/:user/:age +/// @param params 数组顺序要与路由参数顺序对应 +/// @return 生成URL 字符串 ++ (NSString *)generateWithURL:(NSString *)url params:(NSArray *)params; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h.meta new file mode 100644 index 0000000..9c37d88 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSRouter.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eead1a2edc76d48418752677a14257f1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSStandardUI.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSStandardUI.h new file mode 100644 index 0000000..b47b84b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSStandardUI.h @@ -0,0 +1,40 @@ +// +// TDSStandardUI.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2023/8/7. +// + +/* + TDS UI 产品会有一套自己的标准的UI规范,所以代码中也需要整合到一起。 + */ +#import + +NS_ASSUME_NONNULL_BEGIN + +// 默认的放大缩小比例 +CGFloat TDSUIScale(CGFloat value); + +// 目前只记录了 Primary 中的颜色 +@interface TDSColor : NSObject + +// TapTap 主色 #15C5CE ++ (UIColor *)SDKBlue; + +// TapTap 主色 厚度 #09A5AD ++ (UIColor *)SDKBlueThickness; + +// #FFFFFF ++ (UIColor *)white; + +// #F64C4C ++ (UIColor *)red; + +@end + +// 字体 iOS 端默认用苹方,所以用系统的就行 +//@interface TDSFont : NSObject +// +//@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSStandardUI.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSStandardUI.h.meta new file mode 100644 index 0000000..97d75e3 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSStandardUI.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 52ae44f25c23a4741ac353e3160bcc1f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h new file mode 100644 index 0000000..7ccfc06 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h @@ -0,0 +1,107 @@ +// +// TDSThrottle.h +// TDSCommon +// +// Created by JiangJiahao on 2021/3/22. +// + +#import + +/** 自定管理执行与释放时,标记调用来源: 对象/类地址_方法名_调用行数 */ +#define TDSThrottleKey [NSString stringWithFormat:@"%p_%s_%d",self,__func__,__LINE__] +#define TDSThrottleKeyAppendCustom(customKey) [NSString stringWithFormat:@"%p_%s_%d%@",self,__func__,__LINE__,customKey] + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^TDSThrottleTaskBlock)(void); +extern double const THROTTLE_INTERVAL; // 默认频率间隔, 0.5s + +/** + 相邻调用必须间隔超时时间以上才会触发 + */ +@interface TDSThrottle : NSObject +#pragma mark - 自动管理 ++ (TDSThrottle *)throttleWithThrottleKey:(NSString *)throttleKey taskBlock:(TDSThrottleTaskBlock)taskBlock; + ++ (TDSThrottle *)throttleWithInterval:(NSTimeInterval)interval + throttleKey:(NSString *)throttleKey + taskBlock:(TDSThrottleTaskBlock)taskBlock; + +/// 自动执行一个Throttle(节流)任务。 +/// 注意:适用调用不是异常频繁的任务,如用户按钮频繁点击限制 +/// @param interval 防抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param throttleKey 任务来源标识,可使用默认宏 TDSThrottleKey 或 TDSThrottleKeyAppendCustom +/// @param taskBlock 需要执行的任务 ++ (TDSThrottle *)throttleWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + throttleKey:(NSString *)throttleKey + taskBlock:(TDSThrottleTaskBlock)taskBlock; +#pragma mark - 手动管理 ++ (TDSThrottle *)manualThrottleWithTaskBlock:(TDSThrottleTaskBlock)taskBlock; + ++ (TDSThrottle *)manualThrottleWithInterval:(NSTimeInterval)interval + taskBlock:(TDSThrottleTaskBlock)taskBlock; + +/// 手动获取一个Throttle(节流)任务,需要在不再使用时手动调用 dispose 释放 +/// 注意:适合在任务会异常频繁执行时进行限制,如滑动列表时在频繁系统回调中处理的任务 +/// @param interval 抖间隔,默认0.5s +/// @param queue 任务执行队列,默认主队列 +/// @param taskBlock 需要执行的任务 ++ (TDSThrottle *)manualThrottleWithInterval:(NSTimeInterval)interval + onQueue:(dispatch_queue_t)queue + taskBlock:(TDSThrottleTaskBlock)taskBlock; + +#pragma mark - 执行与销毁 +/// 触发任务执行,手动管理时调用 +- (void)invoke; + +/// 销毁任务,手动管理时调用 +- (void)dispose; + +@end + +#pragma mark - private classes +/** + 调用后立即触发,间隔时间未超时无法再次触发,每次调用不会重新计时 + */ +@interface TDSThrottleLeading : TDSThrottle + +@end + +/** + 调用后等待间隔时间超时以后触发,每次调用不会重新计时 + */ +@interface TDSThrottleTrailing : TDSThrottle + +@end + +/** + 使用方法: + 1.自动管理(自动执行/释放) + // 按钮事件或需要执行的函数,任务使用 Throttle 包裹 + - (void)testThrottle { + [TDSThrottleLeading throttleWithInterval:0.8 throttleKey:TDSThrottleKey taskBlock:^{ + // TODO 想要执行的任务 + }]; + } + + 2.手动管理 (创建时调用 manual 开头函数) + + @property (nonatomic, strong) TDSThrottle *testThrottler; + + // 按钮事件或需要执行的函数,任务使用 Throttle 包裹 + - (void)testThrottle { + if (!self.testThrottler) { + self.testThrottler = [TDSThrottleLeading manualThrottleWithTaskBlock:^{ + // TODO 想要执行的任务 + }]; + } + [self.testThrottler invoke]; + } + + // 在适当时机,如退出页面时释放 + [self.testThrottler dispose]; + */ +NS_ASSUME_NONNULL_END + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h.meta new file mode 100644 index 0000000..80f585a --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSThrottle.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4aedb722bb2044494b076d98bc0a422f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h new file mode 100644 index 0000000..d2c6d20 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h @@ -0,0 +1,31 @@ +// +// TDSTrackerConfig.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/15. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +typedef enum : NSUInteger { + TDSTrackerForTapsdk = 1, + TDSTrackerForFriends, + TDSTrackerForNetwork, + TDSTrackerForTapSDKNetwork, + TDSTrackerForTapConnect +} TDSTrackerType; + +@interface TDSTrackerConfig : NSObject +@property (nonatomic, copy) NSString *accessKeyId; +@property (nonatomic, copy) NSString *accessKeySecret; +@property (nonatomic, copy) NSString *project; +@property (nonatomic, copy) NSString *endPoint; +@property (nonatomic, copy) NSString *logStore; +@property (nonatomic, copy) NSString *sdkVersionName; +@property (nonatomic, copy) NSString *sdkVersionCode; +@property (nonatomic, assign) TDSTrackerType trackerType; +@property (nonatomic, assign) NSInteger groupSize; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h.meta new file mode 100644 index 0000000..356a8dd --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d00d4b52fa96147a79118dd4cb90b0a6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h new file mode 100644 index 0000000..3d24713 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h @@ -0,0 +1,51 @@ +// +// TDSTrackerEvent.h +// TapCommonSDK +// +// Created by Bottle K on 2021/6/21. +// + +#import +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + + +@protocol TDSTrackerEventProtocol + +@required + +- (TDSTrackerType)trackerType; + +- (NSDictionary *)getEventDic; + + +@end + + +@interface TDSTrackerEvent : NSObject +//事件类型 +@property (nonatomic, assign) TDSTrackerType trackerType; + +//用户模型 +@property (nonatomic, strong, nullable) UserModel *userModel; + +//页面模型 +@property (nonatomic, strong, nullable) PageModel *pageModel; + +//行为模型 +@property (nonatomic, strong, nullable) ActionModel *actionModel; + +//网络模型 +@property (nonatomic, strong, nullable) NetworkStateModel *networkModel; + +//登录模型 +@property (nonatomic, strong, nullable) LoginModel *loginModel; +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta new file mode 100644 index 0000000..67de23b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 98eaace2ab39741ef9fe7fa2bacbcc10 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h new file mode 100644 index 0000000..f68a4da --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h @@ -0,0 +1,28 @@ +// +// TDSTrackerManager.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSTrackerManager : NSObject + ++ (instancetype)sharedInstance; + ++ (void)registerTracker:(TDSTrackerConfig *)trackerConfig; + +- (void)trackWithEvent:(id)event; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h.meta new file mode 100644 index 0000000..ba11218 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 97eaad897f7fd4dee97104b334e568b4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h new file mode 100644 index 0000000..895eb62 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h @@ -0,0 +1,22 @@ +// +// TDSUrlSafe.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2022/3/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSUrlSafe : NSObject + +// base64 url 编码 ++ (nullable NSString *)base64UrlEncoder:(NSData *)data; + +// base64 url 解码 ++ (nullable NSData *)base64UrlDecoder:(NSString *)str; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h.meta new file mode 100644 index 0000000..c450e14 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSUrlSafe.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fba2e30b59e2a43f1ac49f8d667e1629 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h new file mode 100644 index 0000000..0efc47b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h @@ -0,0 +1,19 @@ +// +// WKCookieWebview.h +// NativeApp +// +// Created by JiangJiahao on 2019/4/3. +// Copyright © 2019 JiangJiahao. All rights reserved. +// 处理wkwebview的cookie问题 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSWKCookieWebview : WKWebView +- (id)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration useRedirectCookie:(BOOL)useRedirectCookie; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h.meta new file mode 100644 index 0000000..642f54e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKCookieWebview.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6289f39f5fcc940278ca7273692a0e17 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h new file mode 100755 index 0000000..dd3506f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h @@ -0,0 +1,35 @@ +// +// WKWebViewJavascriptBridge.h +// +// Created by @LokiMeyburg on 10/15/14. +// Copyright (c) 2014 @LokiMeyburg. All rights reserved. +// + +#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1) +#define supportsWKWebView +#endif + +#if defined supportsWKWebView + +#import +#import +#import + +@interface TDSWKWebViewJavascriptBridge : NSObject + ++ (instancetype)bridgeForWebView:(WKWebView*)webView; ++ (void)enableLogging; + +- (void)registerHandler:(NSString*)handlerName handler:(TDSWVJBHandler)handler; +- (void)removeHandler:(NSString*)handlerName; +- (void)callHandler:(NSString*)handlerName; +- (void)callHandler:(NSString*)handlerName data:(id)data; +- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(TDSWVJBResponseCallback)responseCallback; +- (void)reset; +- (void)setWebViewDelegate:(id)webViewDelegate; +- (void)disableJavscriptAlertBoxSafetyTimeout; +- (NSArray *)getSupportHandlerNameArray; + +@end + +#endif diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h.meta new file mode 100644 index 0000000..fd5484d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWKWebViewJavascriptBridge.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7e26c29b29e644d0185d39bf78a8a22a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h new file mode 100644 index 0000000..e81edaa --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////////////////////////////// +// +// TDSWSSecurity.h +// +// Created by Austin and Dalton Cherry on on 9/3/15. +// Copyright (c) 2014-2017 Austin Cherry. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +////////////////////////////////////////////////////////////////////////////////////////////////// + +#import +#import + +@interface TDSWSSSLCert : NSObject + +/** + Designated init for certificates + + :param: data is the binary data of the certificate + + :returns: a representation security object to be used with + */ +- (instancetype)initWithData:(NSData *)data; + + +/** + Designated init for public keys + + :param: key is the public key to be used + + :returns: a representation security object to be used with + */ +- (instancetype)initWithKey:(SecKeyRef)key; + +@end + +@interface TDSWSSecurity : NSObject + +/** + Use certs from main app bundle + + :param usePublicKeys: is to specific if the publicKeys or certificates should be used for SSL pinning validation + + :returns: a representation security object to be used with + */ +- (instancetype)initWithCerts:(NSArray*)certs publicKeys:(BOOL)publicKeys; + +/** + Designated init + + :param keys: is the certificates or public keys to use + :param usePublicKeys: is to specific if the publicKeys or certificates should be used for SSL pinning validation + + :returns: a representation security object to be used with + */ +- (instancetype)initUsingPublicKeys:(BOOL)publicKeys; + +/** + Should the domain name be validated? Default is YES. + */ +@property(nonatomic)BOOL validatedDN; + +/** + Validate if the cert is legit or not. + :param: trust is the trust to validate + :param: domain to validate along with the trust (can be nil) + :return: YES or NO if valid. + */ +- (BOOL)isValid:(SecTrustRef)trust domain:(NSString*)domain; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h.meta new file mode 100644 index 0000000..fb3a62f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSSecurity.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6600db9066ecc4a648ed0c1a94fbda1f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h new file mode 100644 index 0000000..e840aa0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h @@ -0,0 +1,189 @@ +////////////////////////////////////////////////////////////////////////////////////////////////// +// +// TDSWSWebSocket.h +// +// Created by Austin and Dalton Cherry on on 5/13/14. +// Copyright (c) 2014-2017 Austin Cherry. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +////////////////////////////////////////////////////////////////////////////////////////////////// + +#import +#import + +@class TDSWSWebSocket; + +/** + It is important to note that all the delegate methods are put back on the main thread. + This means if you want to do some major process of the data, you need to create a background thread. + */ +@protocol TDSWSWebSocketDelegate + +@optional +/** + The websocket connected to its host. + @param socket is the current socket object. + */ +-(void)websocketDidConnect:(nonnull TDSWSWebSocket*)socket; + +/** + The websocket was disconnected from its host. + @param socket is the current socket object. + @param error is return an error occured to trigger the disconnect. + */ +-(void)websocketDidDisconnect:(nonnull TDSWSWebSocket*)socket error:(nullable NSError*)error; + +/** + The websocket got a text based message. + @param socket is the current socket object. + @param string is the text based data that has been returned. + */ +-(void)websocket:(nonnull TDSWSWebSocket*)socket didReceiveMessage:(nonnull NSString*)string; + +/** + The websocket got a binary based message. + @param socket is the current socket object. + @param data is the binary based data that has been returned. + */ +-(void)websocket:(nonnull TDSWSWebSocket*)socket didReceiveData:(nullable NSData*)data; + +/** + The websocket got a pong. + @param socket is the current socket object. + @param data is the binary based data that has been returned. + */ +-(void)websocket:(nonnull TDSWSWebSocket*)socket didReceivePong:(nullable NSData*)data; + +@end + +@interface TDSWSWebSocket : NSObject + +@property(nonatomic,weak, nullable)iddelegate; +@property(nonatomic, readonly, nonnull) NSURL *url; + +/** + constructor to create a new websocket with QOS_CLASS_UTILITY dispatch queue + @param url the host you want to connect to. + @param protocols the websocket protocols you want to use (e.g. chat,superchat). + @return a newly initalized websocket. + */ +- (nonnull instancetype)initWithURL:(nonnull NSURL *)url protocols:(nullable NSArray*)protocols; + +/** + constructor to create a new websocket + @param url the host you want to connect to. + @param protocols the websocket protocols you want to use (e.g. chat,superchat). + @param callbackQueue the dispatch queue for handling callbacks + @return a newly initalized websocket. + */ +- (nonnull instancetype)initWithURL:(nonnull NSURL *)url protocols:(nullable NSArray*)protocols callbackQueue:(nonnull dispatch_queue_t)callbackQueue; + +/** + constructor to create a new websocket + @param url the host you want to connect to. + @param protocols the websocket protocols you want to use (e.g. chat,superchat). + @param callbackQueue the dispatch queue for handling callbacks + @param connectTimeout timeout for blocking connect + @return a newly initalized websocket. + */ +- (nonnull instancetype)initWithURL:(nonnull NSURL *)url protocols:(nullable NSArray*)protocols callbackQueue:(nonnull dispatch_queue_t)callbackQueue connectTimeout:(NSTimeInterval)connectTimeout; + +/** + connect to the host + */ +- (void)connect; + +/** + disconnect to the host. This sends the close Connection opcode to terminate cleanly. + */ +- (void)disconnect; + +/** + write binary based data to the socket. + @param data the binary data to write. + */ +- (void)writeData:(nonnull NSData*)data; + +/** + write text based data to the socket. + @param string the string to write. + */ +- (void)writeString:(nonnull NSString*)string; + +/** + write ping to the socket. + @param data the binary data to write (if desired). + */ +- (void)writePing:(nonnull NSData*)data; + +/** + Add a header to send along on the the HTTP connect. + @param value the string to send + @param key the HTTP key name to send + */ +- (void)addHeader:(nonnull NSString*)value forKey:(nonnull NSString*)key; + +/** + returns if the socket is conneted or not. + */ +@property(nonatomic, assign, readonly)BOOL isConnected; + +/** + Enable VOIP support on the socket, so it can be used in the background for VOIP calls. + Default setting is No. + */ +@property(nonatomic, assign)BOOL voipEnabled; + +/** + Allows connection to self signed or untrusted WebSocket connection. Useful for development. + Default setting is No. + */ +@property(nonatomic, assign)BOOL selfSignedSSL; + +/** + Use for SSL pinning. + */ +@property(nonatomic, strong, nullable)TDSWSSecurity *security; + +/** + Set your own custom queue. + Default setting is dispatch_get_main_queue. + */ +@property(nonatomic, strong, nullable)dispatch_queue_t queue; + +/** + Block property to use on connect. + */ +@property(nonatomic, strong, nullable)void (^onConnect)(void); + +/** + Block property to use on disconnect. + */ +@property(nonatomic, strong, nullable)void (^onDisconnect)(NSError*_Nullable); + +/** + Block property to use on receiving data. + */ +@property(nonatomic, strong, nullable)void (^onData)(NSData*_Nullable); + +/** + Block property to use on receiving text. + */ +@property(nonatomic, strong, nullable)void (^onText)(NSString*_Nullable); + +/** + Block property to use on receiving pong. + */ +@property(nonatomic, strong, nullable)void (^onPong)(NSData*_Nullable); +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h.meta new file mode 100644 index 0000000..509ece0 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWSWebSocket.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b5b17dc3afb0b4b0d9325c7984aecbad +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h new file mode 100644 index 0000000..d0f58ee --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h @@ -0,0 +1,21 @@ +// +// XDWebImageView.h +// NativeApp +// +// Created by JiangJiahao on 2018/10/16. +// Copyright © 2018 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSWebImageView : UIImageView + +- (void)setImageWithUrl:(NSString *)imageUrl; + +- (void)setImageWithUrl:(nullable NSString *)imageUrl placeholderImage:(nullable UIImage *)placeholder; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h.meta new file mode 100644 index 0000000..549b9ea --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebImageView.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d2228be5163c14be6bedef5a417fa77c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h new file mode 100755 index 0000000..be4c2a4 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h @@ -0,0 +1,46 @@ +// +// TapTapForumWebViewJavascriptBridgeBase.h +// +// Created by @LokiMeyburg on 10/15/14. +// Copyright (c) 2014 @LokiMeyburg. All rights reserved. +// + +#import + +#define kOldProtocolScheme @"wvjbscheme" +#define kNewProtocolScheme @"https" +#define kQueueHasMessage @"__wvjb_queue_message__" +#define kBridgeLoaded @"__bridge_loaded__" + +typedef void (^TDSWVJBResponseCallback)(id responseData); +typedef void (^TDSWVJBHandler)(id data, TDSWVJBResponseCallback responseCallback); +typedef NSDictionary ForumWVJBMessage; + +@protocol TDSWebViewJavascriptBridgeBaseDelegate +- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand; +@end + +@interface TDSWebViewJavascriptBridgeBase : NSObject + + +@property (weak, nonatomic) id delegate; +@property (strong, nonatomic) NSMutableArray* startupMessageQueue; +@property (strong, nonatomic) NSMutableDictionary* responseCallbacks; +@property (strong, nonatomic) NSMutableDictionary* messageHandlers; +@property (strong, nonatomic) TDSWVJBHandler messageHandler; + ++ (void)enableLogging; ++ (void)setLogMaxLength:(int)length; +- (void)reset; +- (void)sendData:(id)data responseCallback:(TDSWVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName; +- (void)flushMessageQueue:(NSString *)messageQueueString; +- (void)injectJavascriptFile; +- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url; +- (BOOL)isQueueMessageURL:(NSURL*)urll; +- (BOOL)isBridgeLoadedURL:(NSURL*)urll; +- (void)logUnkownMessage:(NSURL*)url; +- (NSString *)webViewJavascriptCheckCommand; +- (NSString *)webViewJavascriptFetchQueyCommand; +- (void)disableJavscriptAlertBoxSafetyTimeout; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta new file mode 100644 index 0000000..ef3e007 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dd130a2f4b7ea446c8c982fcd9b9a1f7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h new file mode 100644 index 0000000..61f651b --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h @@ -0,0 +1,662 @@ +/** + * Macros for metaprogramming + * ExtendedC + * + * Copyright (C) 2012 Justin Spahr-Summers + * Released under the MIT license + */ + +#ifndef EXTC_METAMACROS_H +#define EXTC_METAMACROS_H + + +/** + * Executes one or more expressions (which may have a void type, such as a call + * to a function that returns no value) and always returns true. + */ +#define metamacro_exprify(...) \ + ((__VA_ARGS__), true) + +/** + * Returns a string representation of VALUE after full macro expansion. + */ +#define metamacro_stringify(VALUE) \ + metamacro_stringify_(VALUE) + +/** + * Returns A and B concatenated after full macro expansion. + */ +#define metamacro_concat(A, B) \ + metamacro_concat_(A, B) + +/** + * Returns the Nth variadic argument (starting from zero). At least + * N + 1 variadic arguments must be given. N must be between zero and twenty, + * inclusive. + */ +#define metamacro_at(N, ...) \ + metamacro_concat(metamacro_at, N)(__VA_ARGS__) + +/** + * Returns the number of arguments (up to twenty) provided to the macro. At + * least one argument must be provided. + * + * Inspired by P99: http://p99.gforge.inria.fr + */ +#define metamacro_argcount(...) \ + metamacro_at(20, __VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + +/** + * Identical to #metamacro_foreach_cxt, except that no CONTEXT argument is + * given. Only the index and current argument will thus be passed to MACRO. + */ +#define metamacro_foreach(MACRO, SEP, ...) \ + metamacro_foreach_cxt(metamacro_foreach_iter, SEP, MACRO, __VA_ARGS__) + +/** + * For each consecutive variadic argument (up to twenty), MACRO is passed the + * zero-based index of the current argument, CONTEXT, and then the argument + * itself. The results of adjoining invocations of MACRO are then separated by + * SEP. + * + * Inspired by P99: http://p99.gforge.inria.fr + */ +#define metamacro_foreach_cxt(MACRO, SEP, CONTEXT, ...) \ + metamacro_concat(metamacro_foreach_cxt, metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__) + +/** + * Identical to #metamacro_foreach_cxt. This can be used when the former would + * fail due to recursive macro expansion. + */ +#define metamacro_foreach_cxt_recursive(MACRO, SEP, CONTEXT, ...) \ + metamacro_concat(metamacro_foreach_cxt_recursive, metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__) + +/** + * In consecutive order, appends each variadic argument (up to twenty) onto + * BASE. The resulting concatenations are then separated by SEP. + * + * This is primarily useful to manipulate a list of macro invocations into instead + * invoking a different, possibly related macro. + */ +#define metamacro_foreach_concat(BASE, SEP, ...) \ + metamacro_foreach_cxt(metamacro_foreach_concat_iter, SEP, BASE, __VA_ARGS__) + +/** + * Iterates COUNT times, each time invoking MACRO with the current index + * (starting at zero) and CONTEXT. The results of adjoining invocations of MACRO + * are then separated by SEP. + * + * COUNT must be an integer between zero and twenty, inclusive. + */ +#define metamacro_for_cxt(COUNT, MACRO, SEP, CONTEXT) \ + metamacro_concat(metamacro_for_cxt, COUNT)(MACRO, SEP, CONTEXT) + +/** + * Returns the first argument given. At least one argument must be provided. + * + * This is useful when implementing a variadic macro, where you may have only + * one variadic argument, but no way to retrieve it (for example, because \c ... + * always needs to match at least one argument). + * + * @code +#define varmacro(...) \ + metamacro_head(__VA_ARGS__) + * @endcode + */ +#define metamacro_head(...) \ + metamacro_head_(__VA_ARGS__, 0) + +/** + * Returns every argument except the first. At least two arguments must be + * provided. + */ +#define metamacro_tail(...) \ + metamacro_tail_(__VA_ARGS__) + +/** + * Returns the first N (up to twenty) variadic arguments as a new argument list. + * At least N variadic arguments must be provided. + */ +#define metamacro_take(N, ...) \ + metamacro_concat(metamacro_take, N)(__VA_ARGS__) + +/** + * Removes the first N (up to twenty) variadic arguments from the given argument + * list. At least N variadic arguments must be provided. + */ +#define metamacro_drop(N, ...) \ + metamacro_concat(metamacro_drop, N)(__VA_ARGS__) + +/** + * Decrements VAL, which must be a number between zero and twenty, inclusive. + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_dec(VAL) \ + metamacro_at(VAL, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19) + +/** + * Increments VAL, which must be a number between zero and twenty, inclusive. + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_inc(VAL) \ + metamacro_at(VAL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21) + +/** + * If A is equal to B, the next argument list is expanded; otherwise, the + * argument list after that is expanded. A and B must be numbers between zero + * and twenty, inclusive. Additionally, B must be greater than or equal to A. + * + * @code +// expands to true +metamacro_if_eq(0, 0)(true)(false) +// expands to false +metamacro_if_eq(0, 1)(true)(false) + * @endcode + * + * This is primarily useful when dealing with indexes and counts in + * metaprogramming. + */ +#define metamacro_if_eq(A, B) \ + metamacro_concat(metamacro_if_eq, A)(B) + +/** + * Identical to #metamacro_if_eq. This can be used when the former would fail + * due to recursive macro expansion. + */ +#define metamacro_if_eq_recursive(A, B) \ + metamacro_concat(metamacro_if_eq_recursive, A)(B) + +/** + * Returns 1 if N is an even number, or 0 otherwise. N must be between zero and + * twenty, inclusive. + * + * For the purposes of this test, zero is considered even. + */ +#define metamacro_is_even(N) \ + metamacro_at(N, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1) + +/** + * Returns the logical NOT of B, which must be the number zero or one. + */ +#define metamacro_not(B) \ + metamacro_at(B, 1, 0) + +// IMPLEMENTATION DETAILS FOLLOW! +// Do not write code that depends on anything below this line. +#define metamacro_stringify_(VALUE) # VALUE +#define metamacro_concat_(A, B) A ## B +#define metamacro_foreach_iter(INDEX, MACRO, ARG) MACRO(INDEX, ARG) +#define metamacro_head_(FIRST, ...) FIRST +#define metamacro_tail_(FIRST, ...) __VA_ARGS__ +#define metamacro_consume_(...) +#define metamacro_expand_(...) __VA_ARGS__ + +// implemented from scratch so that metamacro_concat() doesn't end up nesting +#define metamacro_foreach_concat_iter(INDEX, BASE, ARG) metamacro_foreach_concat_iter_(BASE, ARG) +#define metamacro_foreach_concat_iter_(BASE, ARG) BASE ## ARG + +// metamacro_at expansions +#define metamacro_at0(...) metamacro_head(__VA_ARGS__) +#define metamacro_at1(_0, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at2(_0, _1, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at3(_0, _1, _2, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at4(_0, _1, _2, _3, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at5(_0, _1, _2, _3, _4, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at6(_0, _1, _2, _3, _4, _5, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at7(_0, _1, _2, _3, _4, _5, _6, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at8(_0, _1, _2, _3, _4, _5, _6, _7, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at9(_0, _1, _2, _3, _4, _5, _6, _7, _8, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at10(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at11(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at12(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at13(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at14(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at15(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, ...) metamacro_head(__VA_ARGS__) +#define metamacro_at20(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, ...) metamacro_head(__VA_ARGS__) + +// metamacro_foreach_cxt expansions +#define metamacro_foreach_cxt0(MACRO, SEP, CONTEXT) +#define metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0) + +#define metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \ + metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) \ + SEP \ + MACRO(1, CONTEXT, _1) + +#define metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \ + SEP \ + MACRO(2, CONTEXT, _2) + +#define metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + SEP \ + MACRO(3, CONTEXT, _3) + +#define metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + SEP \ + MACRO(4, CONTEXT, _4) + +#define metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + SEP \ + MACRO(5, CONTEXT, _5) + +#define metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + SEP \ + MACRO(6, CONTEXT, _6) + +#define metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + SEP \ + MACRO(7, CONTEXT, _7) + +#define metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + SEP \ + MACRO(8, CONTEXT, _8) + +#define metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + SEP \ + MACRO(9, CONTEXT, _9) + +#define metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + SEP \ + MACRO(10, CONTEXT, _10) + +#define metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + SEP \ + MACRO(11, CONTEXT, _11) + +#define metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + SEP \ + MACRO(12, CONTEXT, _12) + +#define metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + SEP \ + MACRO(13, CONTEXT, _13) + +#define metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + SEP \ + MACRO(14, CONTEXT, _14) + +#define metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + SEP \ + MACRO(15, CONTEXT, _15) + +#define metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + SEP \ + MACRO(16, CONTEXT, _16) + +#define metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + SEP \ + MACRO(17, CONTEXT, _17) + +#define metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + SEP \ + MACRO(18, CONTEXT, _18) + +#define metamacro_foreach_cxt20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \ + metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + SEP \ + MACRO(19, CONTEXT, _19) + +// metamacro_foreach_cxt_recursive expansions +#define metamacro_foreach_cxt_recursive0(MACRO, SEP, CONTEXT) +#define metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0) + +#define metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \ + metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) \ + SEP \ + MACRO(1, CONTEXT, _1) + +#define metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \ + SEP \ + MACRO(2, CONTEXT, _2) + +#define metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \ + SEP \ + MACRO(3, CONTEXT, _3) + +#define metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \ + SEP \ + MACRO(4, CONTEXT, _4) + +#define metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \ + SEP \ + MACRO(5, CONTEXT, _5) + +#define metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \ + SEP \ + MACRO(6, CONTEXT, _6) + +#define metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \ + SEP \ + MACRO(7, CONTEXT, _7) + +#define metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \ + SEP \ + MACRO(8, CONTEXT, _8) + +#define metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \ + SEP \ + MACRO(9, CONTEXT, _9) + +#define metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + SEP \ + MACRO(10, CONTEXT, _10) + +#define metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + SEP \ + MACRO(11, CONTEXT, _11) + +#define metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \ + SEP \ + MACRO(12, CONTEXT, _12) + +#define metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \ + SEP \ + MACRO(13, CONTEXT, _13) + +#define metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \ + SEP \ + MACRO(14, CONTEXT, _14) + +#define metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \ + SEP \ + MACRO(15, CONTEXT, _15) + +#define metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \ + SEP \ + MACRO(16, CONTEXT, _16) + +#define metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \ + SEP \ + MACRO(17, CONTEXT, _17) + +#define metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \ + SEP \ + MACRO(18, CONTEXT, _18) + +#define metamacro_foreach_cxt_recursive20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \ + metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \ + SEP \ + MACRO(19, CONTEXT, _19) + +// metamacro_for_cxt expansions +#define metamacro_for_cxt0(MACRO, SEP, CONTEXT) +#define metamacro_for_cxt1(MACRO, SEP, CONTEXT) MACRO(0, CONTEXT) + +#define metamacro_for_cxt2(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt1(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(1, CONTEXT) + +#define metamacro_for_cxt3(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt2(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(2, CONTEXT) + +#define metamacro_for_cxt4(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt3(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(3, CONTEXT) + +#define metamacro_for_cxt5(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt4(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(4, CONTEXT) + +#define metamacro_for_cxt6(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt5(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(5, CONTEXT) + +#define metamacro_for_cxt7(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt6(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(6, CONTEXT) + +#define metamacro_for_cxt8(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt7(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(7, CONTEXT) + +#define metamacro_for_cxt9(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt8(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(8, CONTEXT) + +#define metamacro_for_cxt10(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt9(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(9, CONTEXT) + +#define metamacro_for_cxt11(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt10(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(10, CONTEXT) + +#define metamacro_for_cxt12(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt11(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(11, CONTEXT) + +#define metamacro_for_cxt13(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt12(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(12, CONTEXT) + +#define metamacro_for_cxt14(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt13(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(13, CONTEXT) + +#define metamacro_for_cxt15(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt14(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(14, CONTEXT) + +#define metamacro_for_cxt16(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt15(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(15, CONTEXT) + +#define metamacro_for_cxt17(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt16(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(16, CONTEXT) + +#define metamacro_for_cxt18(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt17(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(17, CONTEXT) + +#define metamacro_for_cxt19(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt18(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(18, CONTEXT) + +#define metamacro_for_cxt20(MACRO, SEP, CONTEXT) \ + metamacro_for_cxt19(MACRO, SEP, CONTEXT) \ + SEP \ + MACRO(19, CONTEXT) + +// metamacro_if_eq expansions +#define metamacro_if_eq0(VALUE) \ + metamacro_concat(metamacro_if_eq0_, VALUE) + +#define metamacro_if_eq0_0(...) __VA_ARGS__ metamacro_consume_ +#define metamacro_if_eq0_1(...) metamacro_expand_ +#define metamacro_if_eq0_2(...) metamacro_expand_ +#define metamacro_if_eq0_3(...) metamacro_expand_ +#define metamacro_if_eq0_4(...) metamacro_expand_ +#define metamacro_if_eq0_5(...) metamacro_expand_ +#define metamacro_if_eq0_6(...) metamacro_expand_ +#define metamacro_if_eq0_7(...) metamacro_expand_ +#define metamacro_if_eq0_8(...) metamacro_expand_ +#define metamacro_if_eq0_9(...) metamacro_expand_ +#define metamacro_if_eq0_10(...) metamacro_expand_ +#define metamacro_if_eq0_11(...) metamacro_expand_ +#define metamacro_if_eq0_12(...) metamacro_expand_ +#define metamacro_if_eq0_13(...) metamacro_expand_ +#define metamacro_if_eq0_14(...) metamacro_expand_ +#define metamacro_if_eq0_15(...) metamacro_expand_ +#define metamacro_if_eq0_16(...) metamacro_expand_ +#define metamacro_if_eq0_17(...) metamacro_expand_ +#define metamacro_if_eq0_18(...) metamacro_expand_ +#define metamacro_if_eq0_19(...) metamacro_expand_ +#define metamacro_if_eq0_20(...) metamacro_expand_ + +#define metamacro_if_eq1(VALUE) metamacro_if_eq0(metamacro_dec(VALUE)) +#define metamacro_if_eq2(VALUE) metamacro_if_eq1(metamacro_dec(VALUE)) +#define metamacro_if_eq3(VALUE) metamacro_if_eq2(metamacro_dec(VALUE)) +#define metamacro_if_eq4(VALUE) metamacro_if_eq3(metamacro_dec(VALUE)) +#define metamacro_if_eq5(VALUE) metamacro_if_eq4(metamacro_dec(VALUE)) +#define metamacro_if_eq6(VALUE) metamacro_if_eq5(metamacro_dec(VALUE)) +#define metamacro_if_eq7(VALUE) metamacro_if_eq6(metamacro_dec(VALUE)) +#define metamacro_if_eq8(VALUE) metamacro_if_eq7(metamacro_dec(VALUE)) +#define metamacro_if_eq9(VALUE) metamacro_if_eq8(metamacro_dec(VALUE)) +#define metamacro_if_eq10(VALUE) metamacro_if_eq9(metamacro_dec(VALUE)) +#define metamacro_if_eq11(VALUE) metamacro_if_eq10(metamacro_dec(VALUE)) +#define metamacro_if_eq12(VALUE) metamacro_if_eq11(metamacro_dec(VALUE)) +#define metamacro_if_eq13(VALUE) metamacro_if_eq12(metamacro_dec(VALUE)) +#define metamacro_if_eq14(VALUE) metamacro_if_eq13(metamacro_dec(VALUE)) +#define metamacro_if_eq15(VALUE) metamacro_if_eq14(metamacro_dec(VALUE)) +#define metamacro_if_eq16(VALUE) metamacro_if_eq15(metamacro_dec(VALUE)) +#define metamacro_if_eq17(VALUE) metamacro_if_eq16(metamacro_dec(VALUE)) +#define metamacro_if_eq18(VALUE) metamacro_if_eq17(metamacro_dec(VALUE)) +#define metamacro_if_eq19(VALUE) metamacro_if_eq18(metamacro_dec(VALUE)) +#define metamacro_if_eq20(VALUE) metamacro_if_eq19(metamacro_dec(VALUE)) + +// metamacro_if_eq_recursive expansions +#define metamacro_if_eq_recursive0(VALUE) \ + metamacro_concat(metamacro_if_eq_recursive0_, VALUE) + +#define metamacro_if_eq_recursive0_0(...) __VA_ARGS__ metamacro_consume_ +#define metamacro_if_eq_recursive0_1(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_2(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_3(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_4(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_5(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_6(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_7(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_8(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_9(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_10(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_11(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_12(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_13(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_14(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_15(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_16(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_17(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_18(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_19(...) metamacro_expand_ +#define metamacro_if_eq_recursive0_20(...) metamacro_expand_ + +#define metamacro_if_eq_recursive1(VALUE) metamacro_if_eq_recursive0(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive2(VALUE) metamacro_if_eq_recursive1(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive3(VALUE) metamacro_if_eq_recursive2(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive4(VALUE) metamacro_if_eq_recursive3(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive5(VALUE) metamacro_if_eq_recursive4(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive6(VALUE) metamacro_if_eq_recursive5(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive7(VALUE) metamacro_if_eq_recursive6(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive8(VALUE) metamacro_if_eq_recursive7(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive9(VALUE) metamacro_if_eq_recursive8(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive10(VALUE) metamacro_if_eq_recursive9(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive11(VALUE) metamacro_if_eq_recursive10(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive12(VALUE) metamacro_if_eq_recursive11(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive13(VALUE) metamacro_if_eq_recursive12(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive14(VALUE) metamacro_if_eq_recursive13(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive15(VALUE) metamacro_if_eq_recursive14(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive16(VALUE) metamacro_if_eq_recursive15(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive17(VALUE) metamacro_if_eq_recursive16(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive18(VALUE) metamacro_if_eq_recursive17(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive19(VALUE) metamacro_if_eq_recursive18(metamacro_dec(VALUE)) +#define metamacro_if_eq_recursive20(VALUE) metamacro_if_eq_recursive19(metamacro_dec(VALUE)) + +// metamacro_take expansions +#define metamacro_take0(...) +#define metamacro_take1(...) metamacro_head(__VA_ARGS__) +#define metamacro_take2(...) metamacro_head(__VA_ARGS__), metamacro_take1(metamacro_tail(__VA_ARGS__)) +#define metamacro_take3(...) metamacro_head(__VA_ARGS__), metamacro_take2(metamacro_tail(__VA_ARGS__)) +#define metamacro_take4(...) metamacro_head(__VA_ARGS__), metamacro_take3(metamacro_tail(__VA_ARGS__)) +#define metamacro_take5(...) metamacro_head(__VA_ARGS__), metamacro_take4(metamacro_tail(__VA_ARGS__)) +#define metamacro_take6(...) metamacro_head(__VA_ARGS__), metamacro_take5(metamacro_tail(__VA_ARGS__)) +#define metamacro_take7(...) metamacro_head(__VA_ARGS__), metamacro_take6(metamacro_tail(__VA_ARGS__)) +#define metamacro_take8(...) metamacro_head(__VA_ARGS__), metamacro_take7(metamacro_tail(__VA_ARGS__)) +#define metamacro_take9(...) metamacro_head(__VA_ARGS__), metamacro_take8(metamacro_tail(__VA_ARGS__)) +#define metamacro_take10(...) metamacro_head(__VA_ARGS__), metamacro_take9(metamacro_tail(__VA_ARGS__)) +#define metamacro_take11(...) metamacro_head(__VA_ARGS__), metamacro_take10(metamacro_tail(__VA_ARGS__)) +#define metamacro_take12(...) metamacro_head(__VA_ARGS__), metamacro_take11(metamacro_tail(__VA_ARGS__)) +#define metamacro_take13(...) metamacro_head(__VA_ARGS__), metamacro_take12(metamacro_tail(__VA_ARGS__)) +#define metamacro_take14(...) metamacro_head(__VA_ARGS__), metamacro_take13(metamacro_tail(__VA_ARGS__)) +#define metamacro_take15(...) metamacro_head(__VA_ARGS__), metamacro_take14(metamacro_tail(__VA_ARGS__)) +#define metamacro_take16(...) metamacro_head(__VA_ARGS__), metamacro_take15(metamacro_tail(__VA_ARGS__)) +#define metamacro_take17(...) metamacro_head(__VA_ARGS__), metamacro_take16(metamacro_tail(__VA_ARGS__)) +#define metamacro_take18(...) metamacro_head(__VA_ARGS__), metamacro_take17(metamacro_tail(__VA_ARGS__)) +#define metamacro_take19(...) metamacro_head(__VA_ARGS__), metamacro_take18(metamacro_tail(__VA_ARGS__)) +#define metamacro_take20(...) metamacro_head(__VA_ARGS__), metamacro_take19(metamacro_tail(__VA_ARGS__)) + +// metamacro_drop expansions +#define metamacro_drop0(...) __VA_ARGS__ +#define metamacro_drop1(...) metamacro_tail(__VA_ARGS__) +#define metamacro_drop2(...) metamacro_drop1(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop3(...) metamacro_drop2(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop4(...) metamacro_drop3(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop5(...) metamacro_drop4(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop6(...) metamacro_drop5(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop7(...) metamacro_drop6(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop8(...) metamacro_drop7(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop9(...) metamacro_drop8(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop10(...) metamacro_drop9(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop11(...) metamacro_drop10(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop12(...) metamacro_drop11(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop13(...) metamacro_drop12(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop14(...) metamacro_drop13(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop15(...) metamacro_drop14(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop16(...) metamacro_drop15(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop17(...) metamacro_drop16(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop18(...) metamacro_drop17(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop19(...) metamacro_drop18(metamacro_tail(__VA_ARGS__)) +#define metamacro_drop20(...) metamacro_drop19(metamacro_tail(__VA_ARGS__)) + +#endif diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h.meta new file mode 100644 index 0000000..ca436dd --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TDSmetamacro.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c0b906f3572fc4872b523ccc26eb462a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h new file mode 100644 index 0000000..eaa8f34 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h @@ -0,0 +1,22 @@ +// +// TapBillboardConfig.h +// TapCommonSDK +// +// Created by TapTap on 2022/7/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +#define TEMPLATE_NAVIGATE @"navigate" +#define TEMPLATE_IMAGE @"image" + +@interface TapBillboardConfig : NSObject +@property (nonatomic, copy) NSSet *diemensionSet; +@property (nonatomic, copy) NSString *templateType __attribute__((deprecated("useless in other interface"))); +@property (nonatomic, copy) NSString *serverUrl; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h.meta new file mode 100644 index 0000000..91936a2 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapBillboardConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c3e3e2f69bc2e49c09d80ef225f11ff2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h new file mode 100644 index 0000000..1a28ad5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h @@ -0,0 +1,126 @@ +// +// TapCommonSDK.h +// TapCommonSDK +// +// Created by Bottle K on 2021/3/25. +// + +#import + +//! Project version number for TapCommonSDK. +FOUNDATION_EXPORT double TapCommonSDKVersionNumber; + +//! Project version string for TapCommonSDK. +FOUNDATION_EXPORT const unsigned char TapCommonSDKVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import + +#import +#import +#import +#import + +#import + +#import + +#import + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import + +#import +#import +#import +#import + diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h.meta new file mode 100644 index 0000000..10b1d3d --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapCommonSDK.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1f921f37a96a446ecab04681fce79d76 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h new file mode 100644 index 0000000..5c5f8b5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h @@ -0,0 +1,29 @@ +// +// TapConfig.h +// TapBootstrapSDK +// +// Created by Bottle K on 2021/2/24. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSInteger, TapSDKRegionType) { + TapSDKRegionTypeCN, + TapSDKRegionTypeIO +}; + +@interface TapConfig : NSObject +@property (nonatomic, copy) NSString *clientId; +@property (nonatomic, copy) NSString *clientToken; +@property (nonatomic, copy) NSString *serverURL; +@property (nonatomic, assign) TapSDKRegionType region; +@property (nonatomic, strong) TapDBConfig * dbConfig; +@property (nonatomic, strong) TapBillboardConfig *tapBillboardConfig; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta new file mode 100644 index 0000000..4661782 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bde29b5a5b3e7453a96fbe3bb23efdf3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h new file mode 100644 index 0000000..c5a586f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h @@ -0,0 +1,21 @@ +// +// TapDBConfig.h +// TapCommonSDK +// +// Created by Bottle K on 2021/4/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapDBConfig : NSObject +@property (nonatomic, assign) BOOL enable; +@property (nonatomic, copy) NSString *channel; +@property (nonatomic, copy) NSString *gameVersion; +@property (nonatomic, copy) NSDictionary *deviceLoginProperties; +@property (nonatomic, assign, getter=isAdvertiserIDCollectionEnabled) BOOL advertiserIDCollectionEnabled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h.meta new file mode 100644 index 0000000..0de52a5 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapDBConfig.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 81c196055f8014623af8c509ea0eb280 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h new file mode 100644 index 0000000..decc4c9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h @@ -0,0 +1,20 @@ +// +// TapGameUtil.h +// TDSCommon +// +// Created by Bottle K on 2021/2/2. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapGameUtil : NSObject + ++ (BOOL)isTapTapInstalled; + ++ (BOOL)isTapGlobalInstalled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h.meta new file mode 100644 index 0000000..5806043 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapGameUtil.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c707e6e523fd548ff8ed5a8f27fdb331 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h new file mode 100644 index 0000000..3e0ce4c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h @@ -0,0 +1,40 @@ +// +// TapLoginLogManager.h +// TapLoginSDK +// +// Created by Bottle K on 2021/6/22. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapLoginLogManager : NSObject + ++ (instancetype)sharedInstance; + +- (TDSTrackerEvent *)generateNewEvent; + +- (TDSTrackerEvent *)event; + ++ (void)logStart; + ++ (void)logTapOpenWithType:(NSString *)type; + ++ (void)logTapBack; + ++ (void)logTapToken; + ++ (void)logTapProfileWithOpenId:(NSString *_Nullable)openId; + ++ (void)logTapSuccess; + ++ (void)logTapFailWithError:(NSError *)error; + ++ (void)logTapCancel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h.meta new file mode 100644 index 0000000..31a9a1c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapLoginLogManager.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5e75b4a776539400ea3b9be2b91c574e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h new file mode 100644 index 0000000..3cdde81 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h @@ -0,0 +1,22 @@ +// +// TapDBDynamicPropertiesDelegate.h +// TapDB +// +// Created by xe on 2021/4/13. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef const char* _Nullable (*TapPropertiesDelegate)(const char*); + +@interface TapPropertiesDelegateProxy : NSObject + +- (instancetype)initWithDelegate: (TapPropertiesDelegate)delegate key:(NSString*)key; + +- (NSString*) getProperties; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h.meta new file mode 100644 index 0000000..fc548da --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesDelegateProxy.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7738c6fce07b34db5892df25606cb154 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h new file mode 100644 index 0000000..74e7733 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h @@ -0,0 +1,23 @@ +// +// TapDBDynamicPropertiesProxy.h +// TapDB +// +// Created by xe on 2021/4/13. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapPropertiesHolder : NSObject + +@property NSMutableDictionary *dic; + ++ (TapPropertiesHolder*)shareInstance; + +- (NSString*)getProperty:(NSString*)key; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h.meta new file mode 100644 index 0000000..3a4b867 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapPropertiesHolder.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 06468d3b0b52e4b3ea43f7066d7248d0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapTipHUD.h b/Plugins/iOS/TapCommonSDK.framework/Headers/TapTipHUD.h new file mode 100644 index 0000000..70e9b8c --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapTipHUD.h @@ -0,0 +1,22 @@ +// +// TapTipHUD.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2023/9/6. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapTipHUD : UIView + ++ (void)showTip:(NSString *)tip; + ++ (void)showTip:(NSString *)tip imageUrl:(NSString *)imageUrl; + ++ (void)showTip:(NSString *)tip imageUrl:(NSString *)imageUrl timeInterval:(NSTimeInterval)timeInterval; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/TapTipHUD.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/TapTipHUD.h.meta new file mode 100644 index 0000000..745ccab --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/TapTipHUD.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 20ed1d17778d54a9392bd3a8785bb000 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h new file mode 100644 index 0000000..f726464 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h @@ -0,0 +1,35 @@ +// +// UIButton+TDSThrottle.h +// TDSCommon +// +// Created by JiangJiahao on 2021/3/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger,TDSButtonThrottleType) { + TDSButtonThrottleTypeNone = 0, // 正常调用 + TDSButtonThrottleTypeThrottleLeading, // 节流,指定时间间隔内只能调用一次,首次调用时立即触发 + TDSButtonThrottleTypeThrottleTrailing, // 节流,指定时间间隔内只能调用一次,首次调用超时后触发 + TDSButtonThrottleTypeDebunceLeading, // 防抖,相邻调用间隔若小于指定时间间隔,则合并成一次调用,首次调用时立即触发 + TDSButtonThrottleTypeDebunceTrailing, // 防抖,相邻调用间隔若小于指定时间间隔,则合并成一次调用,首次超时后触发 +}; + +@interface UIButton (TDSThrottle) + +@property (nonatomic,assign) TDSButtonThrottleType throttleType; + +@end + +/** + 使用方法: + #import "UIButton+TDSThrottle.h" + + UIButton *testButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [testButton setThrottleType:TDSButtonThrottleTypeDebunceTrailing]; + + */ + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h.meta new file mode 100644 index 0000000..655d595 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIButton+TDSThrottle.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: edc6913b9b8bc47a6ab3bc18862888f3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIColor+TDS.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UIColor+TDS.h new file mode 100644 index 0000000..e013243 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIColor+TDS.h @@ -0,0 +1,33 @@ +// +// UIColor+TDS.h +// TapCommonSDK +// +// Created by 黄驿峰 on 2023/8/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + + +FOUNDATION_EXPORT UIColor * UIColorMakeFromRGB(NSInteger, NSInteger, NSInteger); +FOUNDATION_EXPORT UIColor * UIColorMakeFromRGBA(NSInteger, NSInteger, NSInteger, CGFloat); +//argb或者rgb,就是6位或者8位,确保hex正确,不做错误判断(因为程序员可控),不可控的字符串(列如从网络获取的)自己在封装一层,确保传入的是正确的。 +FOUNDATION_EXPORT UIColor * UIColorMakeFromHex(NSString *); + +// UIColorHex(FFF4ED) +#ifndef UIColorHex +#define UIColorHex(_hex_) UIColorMakeFromHex((__bridge NSString *)CFSTR(#_hex_)) +#endif + + +@interface UIColor (TDS) + ++ (UIColor *)makeWithRed:(NSInteger)red green:(NSInteger)green blue:(NSInteger)blue alpha:(NSInteger)alpha; ++ (UIColor *)makeWithHex:(NSString *)hex; + +@end + + + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIColor+TDS.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UIColor+TDS.h.meta new file mode 100644 index 0000000..f2fa457 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIColor+TDS.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 54a949d347d5847b8a1423fb4c0b5c81 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h new file mode 100755 index 0000000..9cf9a59 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h @@ -0,0 +1,433 @@ +// +// UIView+Toast.h +// Toast +// +// Copyright (c) 2011-2016 Charles Scalesse. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +extern const NSString * CSToastPositionTop; +extern const NSString * CSToastPositionCenter; +extern const NSString * CSToastPositionBottom; + +@class CSToastStyle; + +/** + Toast is an Objective-C category that adds toast notifications to the UIView + object class. It is intended to be simple, lightweight, and easy to use. Most + toast notifications can be triggered with a single line of code. + + The `makeToast:` methods create a new view and then display it as toast. + + The `showToast:` methods display any view as toast. + + */ +@interface UIView (Toast) + +/** + Creates and presents a new toast view with a message and displays it with the + default duration and position. Styled using the shared style. + + @param message The message to be displayed + */ +- (void)makeToast:(NSString *)message; + +/** + Creates and presents a new toast view with a message. Duration and position + can be set explicitly. Styled using the shared style. + + @param message The message to be displayed + @param duration The toast duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + */ +- (void)makeToast:(NSString *)message + duration:(NSTimeInterval)duration + position:(id)position; + + +- (void)makeDebugToast:(NSString *)message duration:(NSTimeInterval)duration position:(id)position; + + +/** + Creates and presents a new toast view with a message. Duration, position, and + style can be set explicitly. + + @param message The message to be displayed + @param duration The toast duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + @param style The style. The shared style will be used when nil + */ +- (void)makeToast:(NSString *)message + duration:(NSTimeInterval)duration + position:(id)position + style:(CSToastStyle *)style; + +/** + Creates and presents a new toast view with a message, title, and image. Duration, + position, and style can be set explicitly. The completion block executes when the + toast view completes. `didTap` will be `YES` if the toast view was dismissed from + a tap. + + @param message The message to be displayed + @param duration The toast duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + @param title The title + @param image The image + @param style The style. The shared style will be used when nil + @param completion The completion block, executed after the toast view disappears. + didTap will be `YES` if the toast view was dismissed from a tap. + */ +- (void)makeToast:(NSString *)message + duration:(NSTimeInterval)duration + position:(id)position + title:(NSString *)title + image:(UIImage *)image + style:(CSToastStyle *)style + completion:(void(^)(BOOL didTap))completion; + +/** + Creates a new toast view with any combination of message, title, and image. + The look and feel is configured via the style. Unlike the `makeToast:` methods, + this method does not present the toast view automatically. One of the showToast: + methods must be used to present the resulting view. + + @warning if message, title, and image are all nil, this method will return nil. + + @param message The message to be displayed + @param title The title + @param image The image + @param style The style. The shared style will be used when nil + @return The newly created toast view + */ +- (UIView *)toastViewForMessage:(NSString *)message + title:(NSString *)title + image:(UIImage *)image + style:(CSToastStyle *)style; + +/** + Dismisses all active toast views. Any toast that is currently being displayed on the + screen is considered active. + + @warning this does not clear toast views that are currently waiting in the queue. The next queued + toast will appear immediately after `hideToasts` completes the dismissal animation. + + */ +- (void)hideToasts; + +/** + Dismisses an active toast view. + + @param toast The active toast view to dismiss. Any toast that is currently being displayed + on the screen is considered active. + + @warning this does not clear a toast view that is currently waiting in the queue. + + */ +- (void)hideToast:(UIView *)toast; + +/** + Creates and displays a new toast activity indicator view at a specified position. + + @warning Only one toast activity indicator view can be presented per superview. Subsequent + calls to `makeToastActivity:` will be ignored until hideToastActivity is called. + + @warning `makeToastActivity:` works independently of the showToast: methods. Toast activity + views can be presented and dismissed while toast views are being displayed. `makeToastActivity:` + has no effect on the queueing behavior of the showToast: methods. + + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + */ +- (void)makeToastActivity:(id)position; + +/** + Dismisses the active toast activity indicator view. + */ +- (void)hideToastActivity; + +/** + Displays any view as toast using the default duration and position. + + @param toast The view to be displayed as toast + */ +- (void)showToast:(UIView *)toast; + +/** + Displays any view as toast at a provided position and duration. The completion block + executes when the toast view completes. `didTap` will be `YES` if the toast view was + dismissed from a tap. + + @param toast The view to be displayed as toast + @param duration The notification duration + @param position The toast's center point. Can be one of the predefined CSToastPosition + constants or a `CGPoint` wrapped in an `NSValue` object. + @param completion The completion block, executed after the toast view disappears. + didTap will be `YES` if the toast view was dismissed from a tap. + */ +- (void)showToast:(UIView *)toast + duration:(NSTimeInterval)duration + position:(id)position + completion:(void(^)(BOOL didTap))completion; + +- (UIImageView *)addImageToastAnimationWithFrame:(CGRect)frame withImageName:(NSString *)imageName; + +@end + +/** + `CSToastStyle` instances define the look and feel for toast views created via the + `makeToast:` methods as well for toast views created directly with + `toastViewForMessage:title:image:style:`. + + @warning `CSToastStyle` offers relatively simple styling options for the default + toast view. If you require a toast view with more complex UI, it probably makes more + sense to create your own custom UIView subclass and present it with the `showToast:` + methods. + */ +@interface CSToastStyle : NSObject + +/** + The background color. Default is `[UIColor blackColor]` at 80% opacity. + */ +@property (strong, nonatomic) UIColor *backgroundColor; + +/** + The title color. Default is `[UIColor whiteColor]`. + */ +@property (strong, nonatomic) UIColor *titleColor; + +/** + The message color. Default is `[UIColor whiteColor]`. + */ +@property (strong, nonatomic) UIColor *messageColor; + +/** + A percentage value from 0.0 to 1.0, representing the maximum width of the toast + view relative to it's superview. Default is 0.8 (80% of the superview's width). + */ +@property (assign, nonatomic) CGFloat maxWidthPercentage; + +/** + A percentage value from 0.0 to 1.0, representing the maximum height of the toast + view relative to it's superview. Default is 0.8 (80% of the superview's height). + */ +@property (assign, nonatomic) CGFloat maxHeightPercentage; + +/** + The spacing from the horizontal edge of the toast view to the content. When an image + is present, this is also used as the padding between the image and the text. + Default is 10.0. + */ +@property (assign, nonatomic) CGFloat horizontalPadding; + +/** + The spacing from the vertical edge of the toast view to the content. When a title + is present, this is also used as the padding between the title and the message. + Default is 10.0. + */ +@property (assign, nonatomic) CGFloat verticalPadding; + +/** + The corner radius. Default is 10.0. + */ +@property (assign, nonatomic) CGFloat cornerRadius; + +/** + The title font. Default is `[UIFont boldSystemFontOfSize:16.0]`. + */ +@property (strong, nonatomic) UIFont *titleFont; + +/** + The message font. Default is `[UIFont systemFontOfSize:16.0]`. + */ +@property (strong, nonatomic) UIFont *messageFont; + +/** + The title text alignment. Default is `NSTextAlignmentLeft`. + */ +@property (assign, nonatomic) NSTextAlignment titleAlignment; + +/** + The message text alignment. Default is `NSTextAlignmentLeft`. + */ +@property (assign, nonatomic) NSTextAlignment messageAlignment; + +/** + The maximum number of lines for the title. The default is 0 (no limit). + */ +@property (assign, nonatomic) NSInteger titleNumberOfLines; + +/** + The maximum number of lines for the message. The default is 0 (no limit). + */ +@property (assign, nonatomic) NSInteger messageNumberOfLines; + +/** + Enable or disable a shadow on the toast view. Default is `NO`. + */ +@property (assign, nonatomic) BOOL displayShadow; + +/** + The shadow color. Default is `[UIColor blackColor]`. + */ +@property (strong, nonatomic) UIColor *shadowColor; + +/** + A value from 0.0 to 1.0, representing the opacity of the shadow. + Default is 0.8 (80% opacity). + */ +@property (assign, nonatomic) CGFloat shadowOpacity; + +/** + The shadow radius. Default is 6.0. + */ +@property (assign, nonatomic) CGFloat shadowRadius; + +/** + The shadow offset. The default is `CGSizeMake(4.0, 4.0)`. + */ +@property (assign, nonatomic) CGSize shadowOffset; + +/** + The image size. The default is `CGSizeMake(80.0, 80.0)`. + */ +@property (assign, nonatomic) CGSize imageSize; + +/** + The size of the toast activity view when `makeToastActivity:` is called. + Default is `CGSizeMake(100.0, 100.0)`. + */ +@property (assign, nonatomic) CGSize activitySize; + +/** + The fade in/out animation duration. Default is 0.2. + */ +@property (assign, nonatomic) NSTimeInterval fadeDuration; + +/** + Creates a new instance of `CSToastStyle` with all the default values set. + */ +- (instancetype)initWithDefaultStyle NS_DESIGNATED_INITIALIZER; + +/** + @warning Only the designated initializer should be used to create + an instance of `CSToastStyle`. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +/** + `CSToastManager` provides general configuration options for all toast + notifications. Backed by a singleton instance. + */ +@interface CSToastManager : NSObject + +/** + Sets the shared style on the singleton. The shared style is used whenever + a `makeToast:` method (or `toastViewForMessage:title:image:style:`) is called + with with a nil style. By default, this is set to `CSToastStyle`'s default + style. + + @param sharedStyle the shared style + */ ++ (void)setSharedStyle:(CSToastStyle *)sharedStyle; + +/** + Gets the shared style from the singlton. By default, this is + `CSToastStyle`'s default style. + + @return the shared style + */ ++ (CSToastStyle *)sharedStyle; + +/** + Enables or disables tap to dismiss on toast views. Default is `YES`. + + @param tapToDismissEnabled YES or NO + */ ++ (void)setTapToDismissEnabled:(BOOL)tapToDismissEnabled; + +/** + Returns `YES` if tap to dismiss is enabled, otherwise `NO`. + Default is `YES`. + + @return BOOL YES or NO + */ ++ (BOOL)isTapToDismissEnabled; + +/** + Enables or disables queueing behavior for toast views. When `YES`, + toast views will appear one after the other. When `NO`, multiple Toast + views will appear at the same time (potentially overlapping depending + on their positions). This has no effect on the toast activity view, + which operates independently of normal toast views. Default is `YES`. + + @param queueEnabled YES or NO + */ ++ (void)setQueueEnabled:(BOOL)queueEnabled; + +/** + Returns `YES` if the queue is enabled, otherwise `NO`. + Default is `YES`. + + @return BOOL + */ ++ (BOOL)isQueueEnabled; + +/** + Sets the default duration. Used for the `makeToast:` and + `showToast:` methods that don't require an explicit duration. + Default is 3.0. + + @param duration The toast duration + */ ++ (void)setDefaultDuration:(NSTimeInterval)duration; + +/** + Returns the default duration. Default is 3.0. + + @return duration The toast duration +*/ ++ (NSTimeInterval)defaultDuration; + +/** + Sets the default position. Used for the `makeToast:` and + `showToast:` methods that don't require an explicit position. + Default is `CSToastPositionBottom`. + + @param position The default center point. Can be one of the predefined + CSToastPosition constants or a `CGPoint` wrapped in an `NSValue` object. + */ ++ (void)setDefaultPosition:(id)position; + +/** + Returns the default toast position. Default is `CSToastPositionBottom`. + + @return position The default center point. Will be one of the predefined + CSToastPosition constants or a `CGPoint` wrapped in an `NSValue` object. + */ ++ (id)defaultPosition; + +@end diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h.meta new file mode 100644 index 0000000..635b787 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UIView+Toast.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8c2156b58593f467cb2cb3f5f4017d4a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h new file mode 100644 index 0000000..9ef6fa9 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h @@ -0,0 +1,22 @@ +// +// UserModel.h +// TDSCommon +// +// Created by TapTap-David on 2021/1/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UserModel : NSObject +//用户id +@property (nonatomic, copy) NSString *user_id; +//用户名 +@property (nonatomic, copy) NSString *user_name; +//taptap 授权的open_id +@property (nonatomic, copy) NSString *taptap_open_id; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta new file mode 100644 index 0000000..033fa8e --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ca785bcf919484f10bf6b2c1dd8c6baf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h new file mode 100644 index 0000000..d6bc294 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h @@ -0,0 +1,21 @@ +// +// WKCookieWebview+CookiesHandle.h +// NativeApp +// +// Created by JiangJiahao on 2019/4/3. +// Copyright © 2019 JiangJiahao. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TDSWKCookieWebview (CookiesHandle) + +- (void)syncCookies:(NSURLRequest *)request task:(nullable NSURLSessionTask *)task complitionHandle:(void(^)(NSURLRequest *newRequest))complitionHandle; + +- (void)syncCookiesInJS:(nullable NSURLRequest *)request; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h.meta b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h.meta new file mode 100644 index 0000000..e08641f --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Headers/WKCookieWebview+CookiesHandle.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0f6198df9bb78418292f73ff4e996b1d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Info.plist b/Plugins/iOS/TapCommonSDK.framework/Info.plist new file mode 100644 index 0000000..8572c65 Binary files /dev/null and b/Plugins/iOS/TapCommonSDK.framework/Info.plist differ diff --git a/Plugins/iOS/TapCommonSDK.framework/Info.plist.meta b/Plugins/iOS/TapCommonSDK.framework/Info.plist.meta new file mode 100644 index 0000000..85aee96 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a008705e912f7425ea9f75c3fc35eebf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Modules.meta b/Plugins/iOS/TapCommonSDK.framework/Modules.meta new file mode 100644 index 0000000..73ec2ab --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3615f473aafc54094a79ed6af0fefafc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap new file mode 100644 index 0000000..c250605 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module TapCommonSDK { + umbrella header "TapCommonSDK.h" + + export * + module * { export * } +} diff --git a/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap.meta b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap.meta new file mode 100644 index 0000000..12d2de2 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/Modules/module.modulemap.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 70ff07e9e778a4bc2a05b3a54add6699 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK new file mode 100644 index 0000000..109e0d2 Binary files /dev/null and b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK differ diff --git a/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK.meta b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK.meta new file mode 100644 index 0000000..0bf4363 --- /dev/null +++ b/Plugins/iOS/TapCommonSDK.framework/TapCommonSDK.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cdf17089d27b848dfafa120c09f03e90 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb2dfb0 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +## [TapTap.Common](./Documentation/README.md) \ No newline at end of file diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..1efb54d --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 89f5ee69b81f54617b295e119ceb2f32 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources.meta b/Resources.meta new file mode 100644 index 0000000..9d865bd --- /dev/null +++ b/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce28613a509714fe2bde9bfb79a610bb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Fonts.meta b/Resources/Fonts.meta new file mode 100644 index 0000000..e48cca7 --- /dev/null +++ b/Resources/Fonts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 339473477d0894d6593fb5fc9954b0e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Fonts/taptap-sdk-bold.ttf b/Resources/Fonts/taptap-sdk-bold.ttf new file mode 100644 index 0000000..e278157 Binary files /dev/null and b/Resources/Fonts/taptap-sdk-bold.ttf differ diff --git a/Resources/Fonts/taptap-sdk-bold.ttf.meta b/Resources/Fonts/taptap-sdk-bold.ttf.meta new file mode 100644 index 0000000..d54629d --- /dev/null +++ b/Resources/Fonts/taptap-sdk-bold.ttf.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 3b1c92b10dde9426cbbccfbbd9c05cb1 +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: icomoon + fontNames: + - taptap-sdk-bold + fallbackFontReferences: + - {fileID: 12800000, guid: 922f25809659d41b4b23147484bd150d, type: 3} + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Fonts/taptap-sdk.ttf b/Resources/Fonts/taptap-sdk.ttf new file mode 100644 index 0000000..f54b82f Binary files /dev/null and b/Resources/Fonts/taptap-sdk.ttf differ diff --git a/Resources/Fonts/taptap-sdk.ttf.meta b/Resources/Fonts/taptap-sdk.ttf.meta new file mode 100644 index 0000000..b536082 --- /dev/null +++ b/Resources/Fonts/taptap-sdk.ttf.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 922f25809659d41b4b23147484bd150d +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: icomoon + fontNames: + - taptap-sdk + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/Loading.prefab b/Resources/Loading.prefab new file mode 100644 index 0000000..f801eaa --- /dev/null +++ b/Resources/Loading.prefab @@ -0,0 +1,261 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1138495173445114285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9127102694935652778} + - component: {fileID: 3062185400663604511} + - component: {fileID: 6853361318577022366} + - component: {fileID: 7333425585439521949} + - component: {fileID: 216553251484504045} + m_Layer: 5 + m_Name: Loading + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9127102694935652778 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7053660334341111769} + - {fileID: 6725243170288973124} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3062185400663604511 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6853361318577022366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &7333425585439521949 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &216553251484504045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dbd5c6109fcfe46a6acf800615f84b0a, type: 3} + m_Name: + m_EditorClassIdentifier: + canvas: {fileID: 0} + canvasGroup: {fileID: 0} + openOrder: 0 + panelConfig: + animationType: 0 + toppedOrder: 10 + rotater: {fileID: 6725243170288973124} + speed: 500 +--- !u!1 &1726325218397980974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6725243170288973124} + - component: {fileID: 3451134979655710801} + - component: {fileID: 6740354880857316333} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6725243170288973124 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3451134979655710801 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_CullTransparentMesh: 0 +--- !u!114 &6740354880857316333 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 13124a8b3fc8b47b29ef55a02c3f9b15, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7843842294332592314 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7053660334341111769} + - component: {fileID: 8764964144715973437} + - component: {fileID: 1611728940112126731} + m_Layer: 5 + m_Name: Bgm + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7053660334341111769 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7843842294332592314} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8764964144715973437 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7843842294332592314} + m_CullTransparentMesh: 0 +--- !u!114 &1611728940112126731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7843842294332592314} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.34901962} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Resources/Loading.prefab.meta b/Resources/Loading.prefab.meta new file mode 100644 index 0000000..38ff4d9 --- /dev/null +++ b/Resources/Loading.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eb405df7d195944bc9aff978aeb1eadb +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapCommonTip.prefab b/Resources/TapCommonTip.prefab new file mode 100644 index 0000000..0adf1c4 --- /dev/null +++ b/Resources/TapCommonTip.prefab @@ -0,0 +1,191 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1138495173445114285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9127102694935652778} + - component: {fileID: 3062185400663604511} + - component: {fileID: 6853361318577022366} + - component: {fileID: 7333425585439521949} + - component: {fileID: 594910176992853236} + m_Layer: 5 + m_Name: Tip + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9127102694935652778 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 9114159179718277540} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3062185400663604511 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6853361318577022366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &7333425585439521949 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &594910176992853236 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d976458a47d90410fa1669caf419e0fc, type: 3} + m_Name: + m_EditorClassIdentifier: + canvas: {fileID: 0} + canvasGroup: {fileID: 0} + panelConfig: + animationType: 1 + toppedOrder: 9 + text: {fileID: 0} + background: {fileID: 0} + fixVal: 120 + show: "X\xE1c nh\u1EADn th\xF4ng tin" +--- !u!1 &2834967756811503227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9114159179718277540} + - component: {fileID: 3789258745879994999} + - component: {fileID: 7465180183063499933} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9114159179718277540 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3789258745879994999 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_CullTransparentMesh: 0 +--- !u!114 &7465180183063499933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 36 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 36 + m_Alignment: 2 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: diff --git a/Resources/TapCommonTip.prefab.meta b/Resources/TapCommonTip.prefab.meta new file mode 100644 index 0000000..5e55245 --- /dev/null +++ b/Resources/TapCommonTip.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 181c9380e3015404ab464a3c372b3aa3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapCommonToastBlack.prefab b/Resources/TapCommonToastBlack.prefab new file mode 100644 index 0000000..eb16f07 --- /dev/null +++ b/Resources/TapCommonToastBlack.prefab @@ -0,0 +1,528 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &784908744357270256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1362374463538379500} + m_Layer: 5 + m_Name: Root + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1362374463538379500 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 784908744357270256} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 6725243170288973124} + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -150} + m_SizeDelta: {x: 0, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1138495173445114285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9127102694935652778} + - component: {fileID: 3062185400663604511} + - component: {fileID: 6853361318577022366} + - component: {fileID: 7333425585439521949} + - component: {fileID: 594910176992853236} + m_Layer: 5 + m_Name: TapCommonToastBlack + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9127102694935652778 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1362374463538379500} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3062185400663604511 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6853361318577022366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &7333425585439521949 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &594910176992853236 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d976458a47d90410fa1669caf419e0fc, type: 3} + m_Name: + m_EditorClassIdentifier: + canvas: {fileID: 0} + canvasGroup: {fileID: 0} + panelConfig: + animationType: 16 + toppedOrder: 9 + text: {fileID: 0} + background: {fileID: 0} + layout: {fileID: 0} + iconImage: {fileID: 0} + fixVal: 50 + animationTime: 0.5 + sizeDeltaX: 50 +--- !u!1 &1726325218397980974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6725243170288973124} + - component: {fileID: 3451134979655710801} + - component: {fileID: 6740354880857316333} + m_Layer: 5 + m_Name: BGM + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6725243170288973124 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5482986322874465450} + m_Father: {fileID: 1362374463538379500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.26, y: 52.53} + m_SizeDelta: {x: 210, y: 42} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &3451134979655710801 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_CullTransparentMesh: 0 +--- !u!114 &6740354880857316333 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.8509804} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: cd066ff1bcc684932b5dcae4effa9ca5, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1760182246072008436 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5482986322874465450} + - component: {fileID: 4664850341719020502} + m_Layer: 5 + m_Name: Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5482986322874465450 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1760182246072008436} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4095916428595266728} + - {fileID: 9114159179718277540} + m_Father: {fileID: 6725243170288973124} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &4664850341719020502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1760182246072008436} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 8 + m_Right: 0 + m_Top: 9 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 8 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 +--- !u!1 &2834967756811503227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9114159179718277540} + - component: {fileID: 3789258745879994999} + - component: {fileID: 7465180183063499933} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9114159179718277540 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5482986322874465450} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -42} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3789258745879994999 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_CullTransparentMesh: 0 +--- !u!114 &7465180183063499933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 36 + m_Alignment: 4 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "\u5DF2\u767B\u5F55" +--- !u!1 &7763401120556589406 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8123150922358459483} + - component: {fileID: 4759975136191292132} + - component: {fileID: 1556038907289308440} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8123150922358459483 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7763401120556589406} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4095916428595266728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4759975136191292132 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7763401120556589406} + m_CullTransparentMesh: 0 +--- !u!114 &1556038907289308440 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7763401120556589406} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!1 &7837080653710102900 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4095916428595266728} + - component: {fileID: 1700168474539684878} + - component: {fileID: 4314615989886940530} + - component: {fileID: 6742359035200427369} + m_Layer: 5 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4095916428595266728 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7837080653710102900} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8123150922358459483} + m_Father: {fileID: 5482986322874465450} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 24, y: 24} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1700168474539684878 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7837080653710102900} + m_CullTransparentMesh: 0 +--- !u!114 &4314615989886940530 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7837080653710102900} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.003921569} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 21402bd8d33074561bb584777d7514ea, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &6742359035200427369 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7837080653710102900} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 1 diff --git a/Resources/TapCommonToastBlack.prefab.meta b/Resources/TapCommonToastBlack.prefab.meta new file mode 100644 index 0000000..e5fd0c9 --- /dev/null +++ b/Resources/TapCommonToastBlack.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2696a66a64e7045d7a2732567a6e440c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapCommonToastWhite.prefab b/Resources/TapCommonToastWhite.prefab new file mode 100644 index 0000000..0482e76 --- /dev/null +++ b/Resources/TapCommonToastWhite.prefab @@ -0,0 +1,411 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &784908744357270256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1362374463538379500} + m_Layer: 5 + m_Name: Root + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1362374463538379500 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 784908744357270256} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 6725243170288973124} + m_Father: {fileID: 9127102694935652778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -150} + m_SizeDelta: {x: 0, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1138495173445114285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9127102694935652778} + - component: {fileID: 3062185400663604511} + - component: {fileID: 6853361318577022366} + - component: {fileID: 7333425585439521949} + - component: {fileID: 6070856196811468902} + m_Layer: 5 + m_Name: TapCommonToastWhite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9127102694935652778 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1362374463538379500} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3062185400663604511 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6853361318577022366 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &7333425585439521949 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &6070856196811468902 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1138495173445114285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c78c6db6db8846db9178431b30e1c8a0, type: 3} + m_Name: + m_EditorClassIdentifier: + canvas: {fileID: 0} + canvasGroup: {fileID: 0} + panelConfig: + animationType: 16 + toppedOrder: 0 + text: {fileID: 0} + background: {fileID: 0} + iconImage: {fileID: 0} + fixVal: 0 + animationTime: 0.3 +--- !u!1 &1726325218397980974 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6725243170288973124} + - component: {fileID: 3451134979655710801} + - component: {fileID: 6740354880857316333} + m_Layer: 5 + m_Name: BGM + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6725243170288973124 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5482986322874465450} + m_Father: {fileID: 1362374463538379500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.26, y: 52.53} + m_SizeDelta: {x: 210, y: 42} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &3451134979655710801 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_CullTransparentMesh: 0 +--- !u!114 &6740354880857316333 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1726325218397980974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 355381dae42bd4a93b4021b612d234b0, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1760182246072008436 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5482986322874465450} + m_Layer: 5 + m_Name: Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5482986322874465450 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1760182246072008436} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 9114159179718277540} + - {fileID: 8123150922358459483} + m_Father: {fileID: 6725243170288973124} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2834967756811503227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9114159179718277540} + - component: {fileID: 3789258745879994999} + - component: {fileID: 7465180183063499933} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9114159179718277540 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5482986322874465450} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 40, y: 0.22} + m_SizeDelta: {x: 150, y: 37.5672} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &3789258745879994999 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_CullTransparentMesh: 0 +--- !u!114 &7465180183063499933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2834967756811503227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 18 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 36 + m_Alignment: 4 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "\u63D0\u4EA4\u6210\u529F" +--- !u!1 &7763401120556589406 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8123150922358459483} + - component: {fileID: 4759975136191292132} + - component: {fileID: 1556038907289308440} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8123150922358459483 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7763401120556589406} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5482986322874465450} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 8, y: -21} + m_SizeDelta: {x: 24, y: 24} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &4759975136191292132 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7763401120556589406} + m_CullTransparentMesh: 0 +--- !u!114 &1556038907289308440 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7763401120556589406} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 2800000, guid: 7f6e2c20a186643faa712b4ba573a72c, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 diff --git a/Resources/TapCommonToastWhite.prefab.meta b/Resources/TapCommonToastWhite.prefab.meta new file mode 100644 index 0000000..9e9be2b --- /dev/null +++ b/Resources/TapCommonToastWhite.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ef9f69710d0214420ba8f6276461a9fc +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapSDKCommonTapIcon.png b/Resources/TapSDKCommonTapIcon.png new file mode 100644 index 0000000..0f1086f Binary files /dev/null and b/Resources/TapSDKCommonTapIcon.png differ diff --git a/Resources/TapSDKCommonTapIcon.png.meta b/Resources/TapSDKCommonTapIcon.png.meta new file mode 100644 index 0000000..801b260 --- /dev/null +++ b/Resources/TapSDKCommonTapIcon.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 21402bd8d33074561bb584777d7514ea +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapSDKCommonToastBg.png b/Resources/TapSDKCommonToastBg.png new file mode 100644 index 0000000..ecb4780 Binary files /dev/null and b/Resources/TapSDKCommonToastBg.png differ diff --git a/Resources/TapSDKCommonToastBg.png.meta b/Resources/TapSDKCommonToastBg.png.meta new file mode 100644 index 0000000..afe6619 --- /dev/null +++ b/Resources/TapSDKCommonToastBg.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: cd066ff1bcc684932b5dcae4effa9ca5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 36, y: 10, z: 36, w: 10} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapSDKConstantUIRoot.prefab b/Resources/TapSDKConstantUIRoot.prefab new file mode 100644 index 0000000..e49f57a --- /dev/null +++ b/Resources/TapSDKConstantUIRoot.prefab @@ -0,0 +1,100 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4261950774861981618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5350339549409990581} + - component: {fileID: 2204181717241611008} + - component: {fileID: 4600610754894736554} + - component: {fileID: 50905930539700672} + m_Layer: 5 + m_Name: TapSDKConstantUIRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5350339549409990581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &2204181717241611008 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 990 + m_TargetDisplay: 0 +--- !u!114 &4600610754894736554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &50905930539700672 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/Resources/TapSDKConstantUIRoot.prefab.meta b/Resources/TapSDKConstantUIRoot.prefab.meta new file mode 100644 index 0000000..b462876 --- /dev/null +++ b/Resources/TapSDKConstantUIRoot.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0ae8696978cea41f2a04eee465a77042 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapSDKUIRoot.prefab b/Resources/TapSDKUIRoot.prefab new file mode 100644 index 0000000..85de143 --- /dev/null +++ b/Resources/TapSDKUIRoot.prefab @@ -0,0 +1,100 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4261950774861981618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5350339549409990581} + - component: {fileID: 2204181717241611008} + - component: {fileID: 4600610754894736554} + - component: {fileID: 739291991273991942} + m_Layer: 5 + m_Name: TapSDKUIRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5350339549409990581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &2204181717241611008 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 32667 + m_TargetDisplay: 0 +--- !u!114 &4600610754894736554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &739291991273991942 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4261950774861981618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2035d02fd32941b68c5a0400a11e41fe, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 diff --git a/Resources/TapSDKUIRoot.prefab.meta b/Resources/TapSDKUIRoot.prefab.meta new file mode 100644 index 0000000..0ff851a --- /dev/null +++ b/Resources/TapSDKUIRoot.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8c4f80cf8fa64584b3248cf2aed3c87 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapTapBtn_White.png b/Resources/TapTapBtn_White.png new file mode 100644 index 0000000..91f1fed Binary files /dev/null and b/Resources/TapTapBtn_White.png differ diff --git a/Resources/TapTapBtn_White.png.meta b/Resources/TapTapBtn_White.png.meta new file mode 100644 index 0000000..2574003 --- /dev/null +++ b/Resources/TapTapBtn_White.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 20e644766ff0a44dea3dfe9c83270519 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 93, y: 49, z: 82, w: 52} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/TapTapBtn_White_2.png b/Resources/TapTapBtn_White_2.png new file mode 100644 index 0000000..c544411 Binary files /dev/null and b/Resources/TapTapBtn_White_2.png differ diff --git a/Resources/TapTapBtn_White_2.png.meta b/Resources/TapTapBtn_White_2.png.meta new file mode 100644 index 0000000..1392213 --- /dev/null +++ b/Resources/TapTapBtn_White_2.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 6af49a0236d154bf5b445d26721ae72c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/ToastBackground.png b/Resources/ToastBackground.png new file mode 100644 index 0000000..98d4e22 Binary files /dev/null and b/Resources/ToastBackground.png differ diff --git a/Resources/ToastBackground.png.meta b/Resources/ToastBackground.png.meta new file mode 100644 index 0000000..117506d --- /dev/null +++ b/Resources/ToastBackground.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 9da4db41a3dd74a0aa5505d0c771b4fb +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 70, y: 78, z: 92, w: 58} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/success.png b/Resources/success.png new file mode 100644 index 0000000..5b47149 Binary files /dev/null and b/Resources/success.png differ diff --git a/Resources/success.png.meta b/Resources/success.png.meta new file mode 100644 index 0000000..295e382 --- /dev/null +++ b/Resources/success.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: d25c3c8620cc04100b98842d8a94920c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-bg.png b/Resources/taptap-bg.png new file mode 100644 index 0000000..057f714 Binary files /dev/null and b/Resources/taptap-bg.png differ diff --git a/Resources/taptap-bg.png.meta b/Resources/taptap-bg.png.meta new file mode 100644 index 0000000..67cc7df --- /dev/null +++ b/Resources/taptap-bg.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 86b9e58454341479496cd09b34eb515a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 300 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-close.png b/Resources/taptap-close.png new file mode 100644 index 0000000..ec8c659 Binary files /dev/null and b/Resources/taptap-close.png differ diff --git a/Resources/taptap-close.png.meta b/Resources/taptap-close.png.meta new file mode 100644 index 0000000..2d1978f --- /dev/null +++ b/Resources/taptap-close.png.meta @@ -0,0 +1,146 @@ +fileFormatVersion: 2 +guid: 362d3f2c5cb32453383f03bdcaf75f76 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 300 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-router.png b/Resources/taptap-router.png new file mode 100644 index 0000000..10d960a Binary files /dev/null and b/Resources/taptap-router.png differ diff --git a/Resources/taptap-router.png.meta b/Resources/taptap-router.png.meta new file mode 100644 index 0000000..45dacc6 --- /dev/null +++ b/Resources/taptap-router.png.meta @@ -0,0 +1,146 @@ +fileFormatVersion: 2 +guid: c40d5e66443dd4ee892103750b8d2d5f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 300 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-sdk-refresh 1.png b/Resources/taptap-sdk-refresh 1.png new file mode 100644 index 0000000..36ae8b1 Binary files /dev/null and b/Resources/taptap-sdk-refresh 1.png differ diff --git a/Resources/taptap-sdk-refresh 1.png.meta b/Resources/taptap-sdk-refresh 1.png.meta new file mode 100644 index 0000000..7ca08fb --- /dev/null +++ b/Resources/taptap-sdk-refresh 1.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 13124a8b3fc8b47b29ef55a02c3f9b15 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-toast-error.png b/Resources/taptap-toast-error.png new file mode 100644 index 0000000..6e98d25 Binary files /dev/null and b/Resources/taptap-toast-error.png differ diff --git a/Resources/taptap-toast-error.png.meta b/Resources/taptap-toast-error.png.meta new file mode 100644 index 0000000..312abb6 --- /dev/null +++ b/Resources/taptap-toast-error.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 8dbdef93e1eab46f1842e9f307a9f0c5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-toast-info.png b/Resources/taptap-toast-info.png new file mode 100644 index 0000000..b4c65d5 Binary files /dev/null and b/Resources/taptap-toast-info.png differ diff --git a/Resources/taptap-toast-info.png.meta b/Resources/taptap-toast-info.png.meta new file mode 100644 index 0000000..6f6e7b7 --- /dev/null +++ b/Resources/taptap-toast-info.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: bdd66121e4da849a788349fd769846f1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-toast-success.png b/Resources/taptap-toast-success.png new file mode 100644 index 0000000..5b1249b Binary files /dev/null and b/Resources/taptap-toast-success.png differ diff --git a/Resources/taptap-toast-success.png.meta b/Resources/taptap-toast-success.png.meta new file mode 100644 index 0000000..759dd46 --- /dev/null +++ b/Resources/taptap-toast-success.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 7f6e2c20a186643faa712b4ba573a72c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/taptap-toast-warning.png b/Resources/taptap-toast-warning.png new file mode 100644 index 0000000..1d352d1 Binary files /dev/null and b/Resources/taptap-toast-warning.png differ diff --git a/Resources/taptap-toast-warning.png.meta b/Resources/taptap-toast-warning.png.meta new file mode 100644 index 0000000..9b0be01 --- /dev/null +++ b/Resources/taptap-toast-warning.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: fb58d4a8f1c9348908d813d5a1913985 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime.meta b/Runtime.meta new file mode 100644 index 0000000..e3a1af1 --- /dev/null +++ b/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d7323abeacb8497eb56323d36b5e9c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal.meta b/Runtime/Internal.meta new file mode 100644 index 0000000..812cfee --- /dev/null +++ b/Runtime/Internal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c1bf1616379542c59c3f10c9409a24e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration.meta b/Runtime/Internal/Duration.meta new file mode 100644 index 0000000..ad4cda4 --- /dev/null +++ b/Runtime/Internal/Duration.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2af811b254ef43dc8cc9099920118b78 +timeCreated: 1689653399 \ No newline at end of file diff --git a/Runtime/Internal/Duration/Impl.meta b/Runtime/Internal/Duration/Impl.meta new file mode 100644 index 0000000..369cb8c --- /dev/null +++ b/Runtime/Internal/Duration/Impl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 01d6d9170b5741dfbea36dd66043c7be +timeCreated: 1689675188 \ No newline at end of file diff --git a/Runtime/Internal/Duration/Impl/UnityTDSUser.cs b/Runtime/Internal/Duration/Impl/UnityTDSUser.cs new file mode 100644 index 0000000..3d49571 --- /dev/null +++ b/Runtime/Internal/Duration/Impl/UnityTDSUser.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using com.taptap.tapsdk.bindings.csharp; +using LC.Newtonsoft.Json; +using UnityEngine; + +namespace TapTap.Common { + public sealed class UnityTDSUser + { + public const string TAP_AUTH_CHANNEL = "tap_auth"; + public const string TDS_CHANNEL = "tds"; + private readonly Dictionary _userInfo = new Dictionary(); + public bool IsEmpty => _userInfo == null || _userInfo.Count == 0; + + public void UpdateUserInfo(string channel, string userId) { + if (_userInfo.ContainsKey(channel)) { + _userInfo[channel] = userId; + } else { + _userInfo.Add(channel, userId); + } + + if (string.IsNullOrEmpty(userId)) + _userInfo.Remove(channel); + } + + public void Logout() { + _userInfo.Clear(); + } + + public bool ContainTapInfo() { + return _userInfo.ContainsKey(TAP_AUTH_CHANNEL) || _userInfo.ContainsKey(TDS_CHANNEL); + } + + public string GetUserId() { + return JsonConvert.SerializeObject(_userInfo); + } + + public override string ToString() { + return GetUserId(); + } + + // TODO: Implement the following methods + public string GetUserName() { + return ""; + } + + + } +} \ No newline at end of file diff --git a/Runtime/Internal/Duration/Impl/UnityTDSUser.cs.meta b/Runtime/Internal/Duration/Impl/UnityTDSUser.cs.meta new file mode 100644 index 0000000..fd9acdf --- /dev/null +++ b/Runtime/Internal/Duration/Impl/UnityTDSUser.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 80b090676c2a408ebe458fd6f30b0692 +timeCreated: 1689823217 \ No newline at end of file diff --git a/Runtime/Internal/Duration/TapDuration.cs b/Runtime/Internal/Duration/TapDuration.cs new file mode 100644 index 0000000..91ba31d --- /dev/null +++ b/Runtime/Internal/Duration/TapDuration.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.IO; +using com.taptap.tapsdk.bindings.csharp; +using UnityEngine; +using DeviceType = com.taptap.tapsdk.bindings.csharp.DeviceType; + +namespace TapTap.Common.Internal { + internal static class TapDuration { + + private static bool isRndEnvironment; + static TapDuration() { + EventManager.AddListener(EventConst.SetRND, (_) => isRndEnvironment = true); + } + internal static void Init(TapConfig config) { + if (TapCommon.DisableDurationStatistics == false && !isRndEnvironment) { + DurationInit(); + } + } + + + private static void DurationInit() { + try { + if (SupportDurationStatistics()) + DurationBindingInit(); + } + catch (Exception e) { + TapLogger.Error("[Duration] DurationInit Error: " + e.ToString() + "\n" + e.StackTrace); + } + + } + + private static bool SupportDurationStatistics() { +#if ((UNITY_ANDROID || UNITY_IOS ) && !UNITY_EDITOR) + return true; +#elif UNITY_EDITOR + return false; +#elif UNITY_STANDALONE_WIN + return true; +#elif UNITY_STANDALONE_OSX + return false; +#endif + return false; + } + + private static void DurationBindingInit() { + BindGameConfig(); + BindUserInfo(); + BindWindowChange(); + } + + private static void BindGameConfig() { + var bridgeConfig = new BridgeConfig(); + var dir = new DirectoryInfo(Path.Combine(Application.persistentDataPath, "tapsdk")); + if (!dir.Exists) + dir.Create(); + bridgeConfig.cache_dir = dir.FullName; + bridgeConfig.ca_dir = ""; + bridgeConfig.device_id = SystemInfo.deviceUniqueIdentifier; + bridgeConfig.enable_duration_statistics = true; + bridgeConfig.device_type = (int)DeviceType.Local; + Bindings.InitSDK(bridgeConfig); + // Set Game + var bridgeGame = new BridgeGame(); + bridgeGame.client_id = TapCommon.Config.ClientID; + bridgeGame.identify = Application.identifier; + Bindings.SetCurrentGame(bridgeGame); + } + + private static UnityTDSUser unityTdsUser; + private static BridgeUser bridgeUser; + private static void BindUserInfo() { + unityTdsUser = new UnityTDSUser(); + + EventManager.AddListener(EventConst.OnTapLogin, (loginParameter) => { + var kv = loginParameter is KeyValuePair ? (KeyValuePair)loginParameter : default; + if (!string.IsNullOrEmpty(kv.Key)) { + if (unityTdsUser.IsEmpty) { + bridgeUser = new BridgeUser(); + Bindings.SetCurrentUser(bridgeUser); + } + unityTdsUser.UpdateUserInfo(kv.Key, kv.Value); + bridgeUser.user_id = unityTdsUser.GetUserId(); + bridgeUser.contain_tap_info = unityTdsUser.ContainTapInfo(); + } + }); + EventManager.AddListener(EventConst.OnTapLogout, (logoutChannel) => { + if (logoutChannel is string channel && !string.IsNullOrEmpty(channel)) { + unityTdsUser.Logout(); + Bindings.SetCurrentUser(null); + } + }); + + EventManager.AddListener(EventConst.OnBind, (kv) => { + if (!(kv is KeyValuePair)) return; + if (unityTdsUser.IsEmpty) return; + var bindInfo = (KeyValuePair)kv; + if (!string.IsNullOrEmpty(bindInfo.Key)) { + unityTdsUser.UpdateUserInfo(bindInfo.Key, bindInfo.Value); + bridgeUser.user_id = unityTdsUser.GetUserId(); + bridgeUser.contain_tap_info = unityTdsUser.ContainTapInfo(); + } + }); + } + private static void BindWindowChange() { + EventManager.AddListener(EventConst.OnApplicationPause, (isPause) => { + var isPauseBool = (bool)isPause; + if (isPauseBool) { + Bindings.OnWindowBackground(); + } + else { + Bindings.OnWindowForeground(); + } + }); + } + } +} \ No newline at end of file diff --git a/Runtime/Internal/Duration/TapDuration.cs.meta b/Runtime/Internal/Duration/TapDuration.cs.meta new file mode 100644 index 0000000..d980b31 --- /dev/null +++ b/Runtime/Internal/Duration/TapDuration.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9689aa984d4244d2a7f03d0a70b041f1 +timeCreated: 1692245338 \ No newline at end of file diff --git a/Runtime/Internal/Duration/Wrapper.meta b/Runtime/Internal/Duration/Wrapper.meta new file mode 100644 index 0000000..7484500 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: be97dbadf94a4a789e7009fe9a96aee6 +timeCreated: 1689664734 \ No newline at end of file diff --git a/Runtime/Internal/Duration/Wrapper/Bindings.cs b/Runtime/Internal/Duration/Wrapper/Bindings.cs new file mode 100644 index 0000000..7d4a943 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Bindings.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ +using System.Runtime.InteropServices; + +namespace com.taptap.tapsdk.bindings.csharp { + +public class Bindings { +#if UNITY_IOS + public const string DLL_NAME = "__Internal"; +#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX + public const string DLL_NAME = "bindings-csharp"; +#else + public const string DLL_NAME = "bindings-csharp"; +#endif + public static void InitSDK(BridgeConfig config) { + BindingsPINVOKE.InitSDK(BridgeConfig.getCPtr(config)); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + + public static void SetCurrentGame(BridgeGame game) { + BindingsPINVOKE.SetCurrentGame(BridgeGame.getCPtr(game)); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + + public static void SetCurrentUser(BridgeUser user) { + BindingsPINVOKE.SetCurrentUser(BridgeUser.getCPtr(user)); + } + + public static void OnWindowForeground() { + BindingsPINVOKE.OnWindowForeground(); + } + + public static void OnWindowBackground() { + BindingsPINVOKE.OnWindowBackground(); + } + + public static readonly int DEV_TYPE_LOCAL = BindingsPINVOKE.DEV_TYPE_LOCAL_get(); + public static readonly int DEV_TYPE_SANDBOX = BindingsPINVOKE.DEV_TYPE_SANDBOX_get(); + public static readonly int DEV_TYPE_CLOUD = BindingsPINVOKE.DEV_TYPE_CLOUD_get(); +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Bindings.cs.meta b/Runtime/Internal/Duration/Wrapper/Bindings.cs.meta new file mode 100644 index 0000000..f77ce80 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Bindings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 251c2931150fd4f7fa6267c2e03961dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/BindingsPINVOKE.cs b/Runtime/Internal/Duration/Wrapper/BindingsPINVOKE.cs new file mode 100644 index 0000000..171acc3 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BindingsPINVOKE.cs @@ -0,0 +1,317 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ +using System.Runtime.InteropServices; + +namespace com.taptap.tapsdk.bindings.csharp { + +class BindingsPINVOKE { + + protected class SWIGExceptionHelper { + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ExceptionDelegate(string message); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ExceptionArgumentDelegate(string message, string paramName); + + static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); + static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); + static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); + static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); + static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); + static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); + static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); + static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); + static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); + static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); + static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); + + static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); + static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); + static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterExceptionCallbacks_Bindings")] + public static extern void SWIGRegisterExceptionCallbacks_Bindings( + ExceptionDelegate applicationDelegate, + ExceptionDelegate arithmeticDelegate, + ExceptionDelegate divideByZeroDelegate, + ExceptionDelegate indexOutOfRangeDelegate, + ExceptionDelegate invalidCastDelegate, + ExceptionDelegate invalidOperationDelegate, + ExceptionDelegate ioDelegate, + ExceptionDelegate nullReferenceDelegate, + ExceptionDelegate outOfMemoryDelegate, + ExceptionDelegate overflowDelegate, + ExceptionDelegate systemExceptionDelegate); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterExceptionArgumentCallbacks_Bindings")] + public static extern void SWIGRegisterExceptionCallbacksArgument_Bindings( + ExceptionArgumentDelegate argumentDelegate, + ExceptionArgumentDelegate argumentNullDelegate, + ExceptionArgumentDelegate argumentOutOfRangeDelegate); + + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingApplicationException(string message) { + SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingArithmeticException(string message) { + SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingDivideByZeroException(string message) { + SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingIndexOutOfRangeException(string message) { + SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingInvalidCastException(string message) { + SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingInvalidOperationException(string message) { + SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingIOException(string message) { + SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingNullReferenceException(string message) { + SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingOutOfMemoryException(string message) { + SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingOverflowException(string message) { + SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingSystemException(string message) { + SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentException(string message, string paramName) { + SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentNullException(string message, string paramName) { + global::System.Exception e = SWIGPendingException.Retrieve(); + if (e != null) message = message + " Inner Exception: " + e.Message; + SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentOutOfRangeException(string message, string paramName) { + global::System.Exception e = SWIGPendingException.Retrieve(); + if (e != null) message = message + " Inner Exception: " + e.Message; + SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); + } + + static SWIGExceptionHelper() { + SWIGRegisterExceptionCallbacks_Bindings( + applicationDelegate, + arithmeticDelegate, + divideByZeroDelegate, + indexOutOfRangeDelegate, + invalidCastDelegate, + invalidOperationDelegate, + ioDelegate, + nullReferenceDelegate, + outOfMemoryDelegate, + overflowDelegate, + systemDelegate); + + SWIGRegisterExceptionCallbacksArgument_Bindings( + argumentDelegate, + argumentNullDelegate, + argumentOutOfRangeDelegate); + } + } + + protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); + + public class SWIGPendingException { + [global::System.ThreadStatic] + private static global::System.Exception pendingException = null; + private static int numExceptionsPending = 0; + private static global::System.Object exceptionsLock = null; + + public static bool Pending { + get { + bool pending = false; + if (numExceptionsPending > 0) + if (pendingException != null) + pending = true; + return pending; + } + } + + public static void Set(global::System.Exception e) { + if (pendingException != null) + throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); + pendingException = e; + lock(exceptionsLock) { + numExceptionsPending++; + } + } + + public static global::System.Exception Retrieve() { + global::System.Exception e = null; + if (numExceptionsPending > 0) { + if (pendingException != null) { + e = pendingException; + pendingException = null; + lock(exceptionsLock) { + numExceptionsPending--; + } + } + } + return e; + } + + static SWIGPendingException() { + exceptionsLock = new global::System.Object(); + } + } + + + protected class SWIGStringHelper { + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate string SWIGStringDelegate(string message); + static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterStringCallback_Bindings")] + public static extern void SWIGRegisterStringCallback_Bindings(SWIGStringDelegate stringDelegate); + + [AOT.MonoPInvokeCallback(typeof(SWIGStringDelegate))] + static string CreateString(string cString) { + return cString; + } + + static SWIGStringHelper() { + SWIGRegisterStringCallback_Bindings(stringDelegate); + } + } + + static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); + + + static BindingsPINVOKE() { + } + + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_DEV_TYPE_LOCAL_get___")] + public static extern int DEV_TYPE_LOCAL_get(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_DEV_TYPE_SANDBOX_get___")] + public static extern int DEV_TYPE_SANDBOX_get(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_DEV_TYPE_CLOUD_get___")] + public static extern int DEV_TYPE_CLOUD_get(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_enable_duration_statistics_set___")] + public static extern void BridgeConfig_enable_duration_statistics_set(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_enable_duration_statistics_get___")] + public static extern bool BridgeConfig_enable_duration_statistics_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_region_set___")] + public static extern void BridgeConfig_region_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_region_get___")] + public static extern global::System.IntPtr BridgeConfig_region_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_device_id_set___")] + public static extern void BridgeConfig_device_id_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_device_id_get___")] + public static extern string BridgeConfig_device_id_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_cache_dir_set___")] + public static extern void BridgeConfig_cache_dir_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_cache_dir_get___")] + public static extern string BridgeConfig_cache_dir_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_ca_dir_set___")] + public static extern void BridgeConfig_ca_dir_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_ca_dir_get___")] + public static extern string BridgeConfig_ca_dir_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_device_type_set___")] + public static extern void BridgeConfig_device_type_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeConfig_device_type_get___")] + public static extern int BridgeConfig_device_type_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_BridgeConfig___")] + public static extern global::System.IntPtr new_BridgeConfig(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_BridgeConfig___")] + public static extern void delete_BridgeConfig(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeUser_contain_tap_info_set___")] + public static extern void BridgeUser_contain_tap_info_set(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeUser_contain_tap_info_get___")] + public static extern bool BridgeUser_contain_tap_info_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeUser_user_id_set___")] + public static extern void BridgeUser_user_id_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeUser_user_id_get___")] + public static extern string BridgeUser_user_id_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_BridgeUser___")] + public static extern global::System.IntPtr new_BridgeUser(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_BridgeUser___")] + public static extern void delete_BridgeUser(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeGame_client_id_set___")] + public static extern void BridgeGame_client_id_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeGame_client_id_get___")] + public static extern string BridgeGame_client_id_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeGame_identify_set___")] + public static extern void BridgeGame_identify_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_BridgeGame_identify_get___")] + public static extern string BridgeGame_identify_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_BridgeGame___")] + public static extern global::System.IntPtr new_BridgeGame(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_BridgeGame___")] + public static extern void delete_BridgeGame(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_InitSDK___")] + public static extern void InitSDK(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_SetCurrentGame___")] + public static extern void SetCurrentGame(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_SetCurrentUser___")] + public static extern void SetCurrentUser(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_OnWindowForeground___")] + public static extern void OnWindowForeground(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_OnWindowBackground___")] + public static extern void OnWindowBackground(); +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/BindingsPINVOKE.cs.meta b/Runtime/Internal/Duration/Wrapper/BindingsPINVOKE.cs.meta new file mode 100644 index 0000000..1e456f9 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BindingsPINVOKE.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d22450a6520f246949c3412afbc62ad5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/BridgeConfig.cs b/Runtime/Internal/Duration/Wrapper/BridgeConfig.cs new file mode 100644 index 0000000..6068529 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BridgeConfig.cs @@ -0,0 +1,120 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class BridgeConfig : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal BridgeConfig(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BridgeConfig obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~BridgeConfig() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + BindingsPINVOKE.delete_BridgeConfig(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public bool enable_duration_statistics { + set { + BindingsPINVOKE.BridgeConfig_enable_duration_statistics_set(swigCPtr, value); + } + get { + bool ret = BindingsPINVOKE.BridgeConfig_enable_duration_statistics_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_Region region { + set { + BindingsPINVOKE.BridgeConfig_region_set(swigCPtr, SWIGTYPE_p_Region.getCPtr(value)); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_Region ret = new SWIGTYPE_p_Region(BindingsPINVOKE.BridgeConfig_region_get(swigCPtr), true); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public string device_id { + set { + BindingsPINVOKE.BridgeConfig_device_id_set(swigCPtr, value); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + string ret = BindingsPINVOKE.BridgeConfig_device_id_get(swigCPtr); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public string cache_dir { + set { + BindingsPINVOKE.BridgeConfig_cache_dir_set(swigCPtr, value); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + string ret = BindingsPINVOKE.BridgeConfig_cache_dir_get(swigCPtr); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public string ca_dir { + set { + BindingsPINVOKE.BridgeConfig_ca_dir_set(swigCPtr, value); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + string ret = BindingsPINVOKE.BridgeConfig_ca_dir_get(swigCPtr); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public int device_type { + set { + BindingsPINVOKE.BridgeConfig_device_type_set(swigCPtr, value); + } + get { + int ret = BindingsPINVOKE.BridgeConfig_device_type_get(swigCPtr); + return ret; + } + } + + public BridgeConfig() : this(BindingsPINVOKE.new_BridgeConfig(), true) { + } + +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/BridgeConfig.cs.meta b/Runtime/Internal/Duration/Wrapper/BridgeConfig.cs.meta new file mode 100644 index 0000000..301cb9a --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BridgeConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a98b62292e40348e3945cabd951d2cdd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/BridgeGame.cs b/Runtime/Internal/Duration/Wrapper/BridgeGame.cs new file mode 100644 index 0000000..fcfb43f --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BridgeGame.cs @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class BridgeGame : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal BridgeGame(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BridgeGame obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~BridgeGame() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + BindingsPINVOKE.delete_BridgeGame(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public string client_id { + set { + BindingsPINVOKE.BridgeGame_client_id_set(swigCPtr, value); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + string ret = BindingsPINVOKE.BridgeGame_client_id_get(swigCPtr); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public string identify { + set { + BindingsPINVOKE.BridgeGame_identify_set(swigCPtr, value); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + string ret = BindingsPINVOKE.BridgeGame_identify_get(swigCPtr); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public BridgeGame() : this(BindingsPINVOKE.new_BridgeGame(), true) { + } + +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/BridgeGame.cs.meta b/Runtime/Internal/Duration/Wrapper/BridgeGame.cs.meta new file mode 100644 index 0000000..a33cdf6 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BridgeGame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfaf808ebca89450eb1297fc47ffab31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/BridgeUser.cs b/Runtime/Internal/Duration/Wrapper/BridgeUser.cs new file mode 100644 index 0000000..bf315ae --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BridgeUser.cs @@ -0,0 +1,74 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class BridgeUser : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal BridgeUser(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BridgeUser obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~BridgeUser() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + BindingsPINVOKE.delete_BridgeUser(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public bool contain_tap_info { + set { + BindingsPINVOKE.BridgeUser_contain_tap_info_set(swigCPtr, value); + } + get { + bool ret = BindingsPINVOKE.BridgeUser_contain_tap_info_get(swigCPtr); + return ret; + } + } + + public string user_id { + set { + BindingsPINVOKE.BridgeUser_user_id_set(swigCPtr, value); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + } + get { + string ret = BindingsPINVOKE.BridgeUser_user_id_get(swigCPtr); + if (BindingsPINVOKE.SWIGPendingException.Pending) throw BindingsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public BridgeUser() : this(BindingsPINVOKE.new_BridgeUser(), true) { + } + +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/BridgeUser.cs.meta b/Runtime/Internal/Duration/Wrapper/BridgeUser.cs.meta new file mode 100644 index 0000000..72801b5 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/BridgeUser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a425fe0a1d90485f97dac1471ebd2ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/Config.cs b/Runtime/Internal/Duration/Wrapper/Config.cs new file mode 100644 index 0000000..2774467 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Config.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class Config : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal Config(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Config obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~Config() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + TapSDKPINVOKE.delete_Config(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public bool enable_duration_statistics { + set { + TapSDKPINVOKE.Config_enable_duration_statistics_set(swigCPtr, value); + } + get { + bool ret = TapSDKPINVOKE.Config_enable_duration_statistics_get(swigCPtr); + return ret; + } + } + + public Region region { + set { + TapSDKPINVOKE.Config_region_set(swigCPtr, (int)value); + } + get { + Region ret = (Region)TapSDKPINVOKE.Config_region_get(swigCPtr); + return ret; + } + } + + public Config() : this(TapSDKPINVOKE.new_Config(), true) { + } + +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Config.cs.meta b/Runtime/Internal/Duration/Wrapper/Config.cs.meta new file mode 100644 index 0000000..133e557 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Config.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1692f4e5b8d3c4220b0dd956dd0e4e6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/Device.cs b/Runtime/Internal/Duration/Wrapper/Device.cs new file mode 100644 index 0000000..b34f4f4 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Device.cs @@ -0,0 +1,136 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class Device : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private bool swigCMemOwnBase; + + internal Device(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwnBase = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Device obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~Device() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwnBase) { + swigCMemOwnBase = false; + PlatformPINVOKE.delete_Device(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public static void SetCurrent(Device device) { + PlatformPINVOKE.Device_SetCurrent(Device.getCPtr(device)); + if (PlatformPINVOKE.SWIGPendingException.Pending) throw PlatformPINVOKE.SWIGPendingException.Retrieve(); + } + + public static Device GetCurrent() { + global::System.IntPtr cPtr = PlatformPINVOKE.Device_GetCurrent(); + Device ret = (cPtr == global::System.IntPtr.Zero) ? null : new Device(cPtr, true); + return ret; + } + + public virtual string GetDeviceID() { + string ret = PlatformPINVOKE.Device_GetDeviceID(swigCPtr); + if (PlatformPINVOKE.SWIGPendingException.Pending) throw PlatformPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public virtual string GetCacheDir() { + string ret = PlatformPINVOKE.Device_GetCacheDir(swigCPtr); + if (PlatformPINVOKE.SWIGPendingException.Pending) throw PlatformPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public virtual string GetCaCertDir() { + string ret = PlatformPINVOKE.Device_GetCaCertDir(swigCPtr); + if (PlatformPINVOKE.SWIGPendingException.Pending) throw PlatformPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public virtual DeviceType GetDeviceType() { + DeviceType ret = (DeviceType)(SwigDerivedClassHasMethod("GetDeviceType", swigMethodTypes3) ? PlatformPINVOKE.Device_GetDeviceTypeSwigExplicitDevice(swigCPtr) : PlatformPINVOKE.Device_GetDeviceType(swigCPtr)); + if (PlatformPINVOKE.SWIGPendingException.Pending) throw PlatformPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public Device() : this(PlatformPINVOKE.new_Device(), true) { + SwigDirectorConnect(); + } + + private void SwigDirectorConnect() { + if (SwigDerivedClassHasMethod("GetDeviceID", swigMethodTypes0)) + swigDelegate0 = new SwigDelegateDevice_0(SwigDirectorMethodGetDeviceID); + if (SwigDerivedClassHasMethod("GetCacheDir", swigMethodTypes1)) + swigDelegate1 = new SwigDelegateDevice_1(SwigDirectorMethodGetCacheDir); + if (SwigDerivedClassHasMethod("GetCaCertDir", swigMethodTypes2)) + swigDelegate2 = new SwigDelegateDevice_2(SwigDirectorMethodGetCaCertDir); + if (SwigDerivedClassHasMethod("GetDeviceType", swigMethodTypes3)) + swigDelegate3 = new SwigDelegateDevice_3(SwigDirectorMethodGetDeviceType); + PlatformPINVOKE.Device_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3); + } + + private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) { + global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null); + bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(Device)); + return hasDerivedMethod; + } + + private string SwigDirectorMethodGetDeviceID() { + return GetDeviceID(); + } + + private string SwigDirectorMethodGetCacheDir() { + return GetCacheDir(); + } + + private string SwigDirectorMethodGetCaCertDir() { + return GetCaCertDir(); + } + + private int SwigDirectorMethodGetDeviceType() { + return (int)GetDeviceType(); + } + + public delegate string SwigDelegateDevice_0(); + public delegate string SwigDelegateDevice_1(); + public delegate string SwigDelegateDevice_2(); + public delegate int SwigDelegateDevice_3(); + + private SwigDelegateDevice_0 swigDelegate0; + private SwigDelegateDevice_1 swigDelegate1; + private SwigDelegateDevice_2 swigDelegate2; + private SwigDelegateDevice_3 swigDelegate3; + + private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { }; + private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { }; + private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { }; + private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { }; +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Device.cs.meta b/Runtime/Internal/Duration/Wrapper/Device.cs.meta new file mode 100644 index 0000000..601f2d6 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Device.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d9e11a794dbf4c23b68bc4712ba5d14 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/DeviceType.cs b/Runtime/Internal/Duration/Wrapper/DeviceType.cs new file mode 100644 index 0000000..62ef5c0 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/DeviceType.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public enum DeviceType { + Local, + Sandbox, + Cloud +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/DeviceType.cs.meta b/Runtime/Internal/Duration/Wrapper/DeviceType.cs.meta new file mode 100644 index 0000000..0b32083 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/DeviceType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d86bf3119daa4d8582c08e20fac1e21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/Game.cs b/Runtime/Internal/Duration/Wrapper/Game.cs new file mode 100644 index 0000000..0cf5bb7 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Game.cs @@ -0,0 +1,106 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class Game : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private bool swigCMemOwnBase; + + internal Game(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwnBase = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Game obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~Game() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwnBase) { + swigCMemOwnBase = false; + TapSDKPINVOKE.delete_Game(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public static void SetCurrent(Game game) { + TapSDKPINVOKE.Game_SetCurrent(Game.getCPtr(game)); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + } + + public static Game GetCurrent() { + global::System.IntPtr cPtr = TapSDKPINVOKE.Game_GetCurrent(); + Game ret = (cPtr == global::System.IntPtr.Zero) ? null : new Game(cPtr, true); + return ret; + } + + public virtual string GetGameID() { + string ret = TapSDKPINVOKE.Game_GetGameID(swigCPtr); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public virtual string GetPackageName() { + string ret = TapSDKPINVOKE.Game_GetPackageName(swigCPtr); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public Game() : this(TapSDKPINVOKE.new_Game(), true) { + SwigDirectorConnect(); + } + + private void SwigDirectorConnect() { + if (SwigDerivedClassHasMethod("GetGameID", swigMethodTypes0)) + swigDelegate0 = new SwigDelegateGame_0(SwigDirectorMethodGetGameID); + if (SwigDerivedClassHasMethod("GetPackageName", swigMethodTypes1)) + swigDelegate1 = new SwigDelegateGame_1(SwigDirectorMethodGetPackageName); + TapSDKPINVOKE.Game_director_connect(swigCPtr, swigDelegate0, swigDelegate1); + } + + private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) { + global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null); + bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(Game)); + return hasDerivedMethod; + } + + private string SwigDirectorMethodGetGameID() { + return GetGameID(); + } + + private string SwigDirectorMethodGetPackageName() { + return GetPackageName(); + } + + public delegate string SwigDelegateGame_0(); + public delegate string SwigDelegateGame_1(); + + private SwigDelegateGame_0 swigDelegate0; + private SwigDelegateGame_1 swigDelegate1; + + private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { }; + private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { }; +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Game.cs.meta b/Runtime/Internal/Duration/Wrapper/Game.cs.meta new file mode 100644 index 0000000..2df8e51 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Game.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7790dedf270cb4fe0b361f6a4f098cf4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/Platform.cs b/Runtime/Internal/Duration/Wrapper/Platform.cs new file mode 100644 index 0000000..f5fa109 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Platform.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class Platform { +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Platform.cs.meta b/Runtime/Internal/Duration/Wrapper/Platform.cs.meta new file mode 100644 index 0000000..05f414b --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Platform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f6f86e8f2ef2402983b12da0637f4e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/PlatformPINVOKE.cs b/Runtime/Internal/Duration/Wrapper/PlatformPINVOKE.cs new file mode 100644 index 0000000..42531ea --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/PlatformPINVOKE.cs @@ -0,0 +1,259 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +using System.Runtime.InteropServices; + +namespace com.taptap.tapsdk.bindings.csharp { + +class PlatformPINVOKE { + + protected class SWIGExceptionHelper { + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ExceptionDelegate(string message); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ExceptionArgumentDelegate(string message, string paramName); + + static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); + static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); + static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); + static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); + static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); + static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); + static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); + static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); + static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); + static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); + static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); + + static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); + static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); + static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterExceptionCallbacks_Platform")] + public static extern void SWIGRegisterExceptionCallbacks_Platform( + ExceptionDelegate applicationDelegate, + ExceptionDelegate arithmeticDelegate, + ExceptionDelegate divideByZeroDelegate, + ExceptionDelegate indexOutOfRangeDelegate, + ExceptionDelegate invalidCastDelegate, + ExceptionDelegate invalidOperationDelegate, + ExceptionDelegate ioDelegate, + ExceptionDelegate nullReferenceDelegate, + ExceptionDelegate outOfMemoryDelegate, + ExceptionDelegate overflowDelegate, + ExceptionDelegate systemExceptionDelegate); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterExceptionArgumentCallbacks_Platform")] + public static extern void SWIGRegisterExceptionCallbacksArgument_Platform( + ExceptionArgumentDelegate argumentDelegate, + ExceptionArgumentDelegate argumentNullDelegate, + ExceptionArgumentDelegate argumentOutOfRangeDelegate); + + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingApplicationException(string message) { + SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingArithmeticException(string message) { + SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingDivideByZeroException(string message) { + SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingIndexOutOfRangeException(string message) { + SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingInvalidCastException(string message) { + SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingInvalidOperationException(string message) { + SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingIOException(string message) { + SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingNullReferenceException(string message) { + SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingOutOfMemoryException(string message) { + SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingOverflowException(string message) { + SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingSystemException(string message) { + SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); + } + + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentException(string message, string paramName) { + SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentNullException(string message, string paramName) { + global::System.Exception e = SWIGPendingException.Retrieve(); + if (e != null) message = message + " Inner Exception: " + e.Message; + SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentOutOfRangeException(string message, string paramName) { + global::System.Exception e = SWIGPendingException.Retrieve(); + if (e != null) message = message + " Inner Exception: " + e.Message; + SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); + } + + static SWIGExceptionHelper() { + SWIGRegisterExceptionCallbacks_Platform( + applicationDelegate, + arithmeticDelegate, + divideByZeroDelegate, + indexOutOfRangeDelegate, + invalidCastDelegate, + invalidOperationDelegate, + ioDelegate, + nullReferenceDelegate, + outOfMemoryDelegate, + overflowDelegate, + systemDelegate); + + SWIGRegisterExceptionCallbacksArgument_Platform( + argumentDelegate, + argumentNullDelegate, + argumentOutOfRangeDelegate); + } + } + + protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); + + public class SWIGPendingException { + [global::System.ThreadStatic] + private static global::System.Exception pendingException = null; + private static int numExceptionsPending = 0; + private static global::System.Object exceptionsLock = null; + + public static bool Pending { + get { + bool pending = false; + if (numExceptionsPending > 0) + if (pendingException != null) + pending = true; + return pending; + } + } + + public static void Set(global::System.Exception e) { + if (pendingException != null) + throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); + pendingException = e; + lock(exceptionsLock) { + numExceptionsPending++; + } + } + + public static global::System.Exception Retrieve() { + global::System.Exception e = null; + if (numExceptionsPending > 0) { + if (pendingException != null) { + e = pendingException; + pendingException = null; + lock(exceptionsLock) { + numExceptionsPending--; + } + } + } + return e; + } + + static SWIGPendingException() { + exceptionsLock = new global::System.Object(); + } + } + + + protected class SWIGStringHelper { + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate string SWIGStringDelegate(string message); + static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterStringCallback_Platform")] + public static extern void SWIGRegisterStringCallback_Platform(SWIGStringDelegate stringDelegate); + + [AOT.MonoPInvokeCallback(typeof(SWIGStringDelegate))] + static string CreateString(string cString) { + return cString; + } + + static SWIGStringHelper() { + SWIGRegisterStringCallback_Platform(stringDelegate); + } + } + + static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); + + + static PlatformPINVOKE() { + } + + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Window_OnForeground___")] + public static extern void Window_OnForeground(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Window_OnBackground___")] + public static extern void Window_OnBackground(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_Window___")] + public static extern global::System.IntPtr new_Window(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_Window___")] + public static extern void delete_Window(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_SetCurrent___")] + public static extern void Device_SetCurrent(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_GetCurrent___")] + public static extern global::System.IntPtr Device_GetCurrent(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_Device___")] + public static extern void delete_Device(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_GetDeviceID___")] + public static extern string Device_GetDeviceID(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_GetCacheDir___")] + public static extern string Device_GetCacheDir(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_GetCaCertDir___")] + public static extern string Device_GetCaCertDir(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_GetDeviceType___")] + public static extern int Device_GetDeviceType(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_GetDeviceTypeSwigExplicitDevice___")] + public static extern int Device_GetDeviceTypeSwigExplicitDevice(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_Device___")] + public static extern global::System.IntPtr new_Device(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Device_director_connect___")] + public static extern void Device_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Device.SwigDelegateDevice_0 delegate0, Device.SwigDelegateDevice_1 delegate1, Device.SwigDelegateDevice_2 delegate2, Device.SwigDelegateDevice_3 delegate3); +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/PlatformPINVOKE.cs.meta b/Runtime/Internal/Duration/Wrapper/PlatformPINVOKE.cs.meta new file mode 100644 index 0000000..bbdfe33 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/PlatformPINVOKE.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1b4fe93d6e264e86b21896da72e859e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/Region.cs b/Runtime/Internal/Duration/Wrapper/Region.cs new file mode 100644 index 0000000..c601420 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Region.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public enum Region { + CN = 0, + Global +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Region.cs.meta b/Runtime/Internal/Duration/Wrapper/Region.cs.meta new file mode 100644 index 0000000..614c99a --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Region.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6677fe7f5590f4df3b019625a9341d62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/SWIGTYPE_p_Region.cs b/Runtime/Internal/Duration/Wrapper/SWIGTYPE_p_Region.cs new file mode 100644 index 0000000..6ad1920 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/SWIGTYPE_p_Region.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class SWIGTYPE_p_Region { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_Region(global::System.IntPtr cPtr, bool futureUse) { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_Region() { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_Region obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/SWIGTYPE_p_Region.cs.meta b/Runtime/Internal/Duration/Wrapper/SWIGTYPE_p_Region.cs.meta new file mode 100644 index 0000000..f8ff492 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/SWIGTYPE_p_Region.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15d0a99d4385c457c82cddf89aa12758 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/TDSUser.cs b/Runtime/Internal/Duration/Wrapper/TDSUser.cs new file mode 100644 index 0000000..7bb42e3 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/TDSUser.cs @@ -0,0 +1,126 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class TDSUser : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private bool swigCMemOwnBase; + + internal TDSUser(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwnBase = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TDSUser obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~TDSUser() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwnBase) { + swigCMemOwnBase = false; + TapSDKPINVOKE.delete_TDSUser(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public static void SetCurrent(TDSUser user) { + TapSDKPINVOKE.TDSUser_SetCurrent(TDSUser.getCPtr(user)); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + } + + public static TDSUser GetCurrent() { + global::System.IntPtr cPtr = TapSDKPINVOKE.TDSUser_GetCurrent(); + TDSUser ret = (cPtr == global::System.IntPtr.Zero) ? null : new TDSUser(cPtr, true); + return ret; + } + + public TDSUser(string user_id) : this(TapSDKPINVOKE.new_TDSUser__SWIG_0(user_id), true) { + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + SwigDirectorConnect(); + } + + public TDSUser() : this(TapSDKPINVOKE.new_TDSUser__SWIG_1(), true) { + SwigDirectorConnect(); + } + + public virtual string GetUserId() { + string ret = (SwigDerivedClassHasMethod("GetUserId", swigMethodTypes0) ? TapSDKPINVOKE.TDSUser_GetUserIdSwigExplicitTDSUser(swigCPtr) : TapSDKPINVOKE.TDSUser_GetUserId(swigCPtr)); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public virtual string GetUserName() { + string ret = TapSDKPINVOKE.TDSUser_GetUserName(swigCPtr); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public virtual bool ContainTapInfo() { + bool ret = TapSDKPINVOKE.TDSUser_ContainTapInfo(swigCPtr); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void SwigDirectorConnect() { + if (SwigDerivedClassHasMethod("GetUserId", swigMethodTypes0)) + swigDelegate0 = new SwigDelegateTDSUser_0(SwigDirectorMethodGetUserId); + if (SwigDerivedClassHasMethod("GetUserName", swigMethodTypes1)) + swigDelegate1 = new SwigDelegateTDSUser_1(SwigDirectorMethodGetUserName); + if (SwigDerivedClassHasMethod("ContainTapInfo", swigMethodTypes2)) + swigDelegate2 = new SwigDelegateTDSUser_2(SwigDirectorMethodContainTapInfo); + TapSDKPINVOKE.TDSUser_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2); + } + + private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) { + global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null); + bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(TDSUser)); + return hasDerivedMethod; + } + + private string SwigDirectorMethodGetUserId() { + return GetUserId(); + } + + private string SwigDirectorMethodGetUserName() { + return GetUserName(); + } + + private bool SwigDirectorMethodContainTapInfo() { + return ContainTapInfo(); + } + + public delegate string SwigDelegateTDSUser_0(); + public delegate string SwigDelegateTDSUser_1(); + public delegate bool SwigDelegateTDSUser_2(); + + private SwigDelegateTDSUser_0 swigDelegate0; + private SwigDelegateTDSUser_1 swigDelegate1; + private SwigDelegateTDSUser_2 swigDelegate2; + + private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { }; + private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { }; + private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { }; +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/TDSUser.cs.meta b/Runtime/Internal/Duration/Wrapper/TDSUser.cs.meta new file mode 100644 index 0000000..62fd92a --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/TDSUser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d47b35fcf2eae4161ac65d2948afb7cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/TapSDK.cs b/Runtime/Internal/Duration/Wrapper/TapSDK.cs new file mode 100644 index 0000000..7530fd2 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/TapSDK.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class TapSDK { + public static bool Init(Config config) { + bool ret = TapSDKPINVOKE.Init(Config.getCPtr(config)); + if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/TapSDK.cs.meta b/Runtime/Internal/Duration/Wrapper/TapSDK.cs.meta new file mode 100644 index 0000000..8aa11e7 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/TapSDK.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0af6e02e7721a431d94ef73fb74b3d2e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/TapSDKPINVOKE.cs b/Runtime/Internal/Duration/Wrapper/TapSDKPINVOKE.cs new file mode 100644 index 0000000..9c5b74f --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/TapSDKPINVOKE.cs @@ -0,0 +1,288 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +using System.Runtime.InteropServices; + +namespace com.taptap.tapsdk.bindings.csharp { + +class TapSDKPINVOKE { + + protected class SWIGExceptionHelper { + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ExceptionDelegate(string message); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ExceptionArgumentDelegate(string message, string paramName); + + static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException); + static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); + static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); + static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); + static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); + static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); + static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); + static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); + static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException); + static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException); + static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException); + + static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException); + static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); + static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterExceptionCallbacks_TapSDK")] + public static extern void SWIGRegisterExceptionCallbacks_TapSDK( + ExceptionDelegate applicationDelegate, + ExceptionDelegate arithmeticDelegate, + ExceptionDelegate divideByZeroDelegate, + ExceptionDelegate indexOutOfRangeDelegate, + ExceptionDelegate invalidCastDelegate, + ExceptionDelegate invalidOperationDelegate, + ExceptionDelegate ioDelegate, + ExceptionDelegate nullReferenceDelegate, + ExceptionDelegate outOfMemoryDelegate, + ExceptionDelegate overflowDelegate, + ExceptionDelegate systemExceptionDelegate); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterExceptionArgumentCallbacks_TapSDK")] + public static extern void SWIGRegisterExceptionCallbacksArgument_TapSDK( + ExceptionArgumentDelegate argumentDelegate, + ExceptionArgumentDelegate argumentNullDelegate, + ExceptionArgumentDelegate argumentOutOfRangeDelegate); + + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingApplicationException(string message) { + SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingArithmeticException(string message) { + SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingDivideByZeroException(string message) { + SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingIndexOutOfRangeException(string message) { + SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingInvalidCastException(string message) { + SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingInvalidOperationException(string message) { + SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingIOException(string message) { + SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingNullReferenceException(string message) { + SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingOutOfMemoryException(string message) { + SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingOverflowException(string message) { + SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionDelegate))] + static void SetPendingSystemException(string message) { + SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); + } + + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentException(string message, string paramName) { + SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentNullException(string message, string paramName) { + global::System.Exception e = SWIGPendingException.Retrieve(); + if (e != null) message = message + " Inner Exception: " + e.Message; + SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); + } + [AOT.MonoPInvokeCallback(typeof(ExceptionArgumentDelegate))] + static void SetPendingArgumentOutOfRangeException(string message, string paramName) { + global::System.Exception e = SWIGPendingException.Retrieve(); + if (e != null) message = message + " Inner Exception: " + e.Message; + SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); + } + + static SWIGExceptionHelper() { + SWIGRegisterExceptionCallbacks_TapSDK( + applicationDelegate, + arithmeticDelegate, + divideByZeroDelegate, + indexOutOfRangeDelegate, + invalidCastDelegate, + invalidOperationDelegate, + ioDelegate, + nullReferenceDelegate, + outOfMemoryDelegate, + overflowDelegate, + systemDelegate); + + SWIGRegisterExceptionCallbacksArgument_TapSDK( + argumentDelegate, + argumentNullDelegate, + argumentOutOfRangeDelegate); + } + } + + protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); + + public class SWIGPendingException { + [global::System.ThreadStatic] + private static global::System.Exception pendingException = null; + private static int numExceptionsPending = 0; + private static global::System.Object exceptionsLock = null; + + public static bool Pending { + get { + bool pending = false; + if (numExceptionsPending > 0) + if (pendingException != null) + pending = true; + return pending; + } + } + + public static void Set(global::System.Exception e) { + if (pendingException != null) + throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); + pendingException = e; + lock(exceptionsLock) { + numExceptionsPending++; + } + } + + public static global::System.Exception Retrieve() { + global::System.Exception e = null; + if (numExceptionsPending > 0) { + if (pendingException != null) { + e = pendingException; + pendingException = null; + lock(exceptionsLock) { + numExceptionsPending--; + } + } + } + return e; + } + + static SWIGPendingException() { + exceptionsLock = new global::System.Object(); + } + } + + + protected class SWIGStringHelper { + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate string SWIGStringDelegate(string message); + static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="SWIGRegisterStringCallback_TapSDK")] + public static extern void SWIGRegisterStringCallback_TapSDK(SWIGStringDelegate stringDelegate); + [AOT.MonoPInvokeCallback(typeof(SWIGStringDelegate))] + static string CreateString(string cString) { + return cString; + } + + static SWIGStringHelper() { + SWIGRegisterStringCallback_TapSDK(stringDelegate); + } + } + + static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); + + + static TapSDKPINVOKE() { + } + + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_SetCurrent___")] + public static extern void TDSUser_SetCurrent(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_GetCurrent___")] + public static extern global::System.IntPtr TDSUser_GetCurrent(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_TDSUser__SWIG_0___")] + public static extern global::System.IntPtr new_TDSUser__SWIG_0(string jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_TDSUser__SWIG_1___")] + public static extern global::System.IntPtr new_TDSUser__SWIG_1(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_TDSUser___")] + public static extern void delete_TDSUser(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_GetUserId___")] + public static extern string TDSUser_GetUserId(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_GetUserIdSwigExplicitTDSUser___")] + public static extern string TDSUser_GetUserIdSwigExplicitTDSUser(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_GetUserName___")] + public static extern string TDSUser_GetUserName(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_ContainTapInfo___")] + public static extern bool TDSUser_ContainTapInfo(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_TDSUser_director_connect___")] + public static extern void TDSUser_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, TDSUser.SwigDelegateTDSUser_0 delegate0, TDSUser.SwigDelegateTDSUser_1 delegate1, TDSUser.SwigDelegateTDSUser_2 delegate2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Game_SetCurrent___")] + public static extern void Game_SetCurrent(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Game_GetCurrent___")] + public static extern global::System.IntPtr Game_GetCurrent(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_Game___")] + public static extern void delete_Game(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Game_GetGameID___")] + public static extern string Game_GetGameID(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Game_GetPackageName___")] + public static extern string Game_GetPackageName(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_Game___")] + public static extern global::System.IntPtr new_Game(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Game_director_connect___")] + public static extern void Game_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Game.SwigDelegateGame_0 delegate0, Game.SwigDelegateGame_1 delegate1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Config_enable_duration_statistics_set___")] + public static extern void Config_enable_duration_statistics_set(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Config_enable_duration_statistics_get___")] + public static extern bool Config_enable_duration_statistics_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Config_region_set___")] + public static extern void Config_region_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Config_region_get___")] + public static extern int Config_region_get(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_new_Config___")] + public static extern global::System.IntPtr new_Config(); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_delete_Config___")] + public static extern void delete_Config(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(Bindings.DLL_NAME, EntryPoint="CSharp_comftaptapftapsdkfbindingsfcsharp_Init___")] + public static extern bool Init(global::System.Runtime.InteropServices.HandleRef jarg1); +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/TapSDKPINVOKE.cs.meta b/Runtime/Internal/Duration/Wrapper/TapSDKPINVOKE.cs.meta new file mode 100644 index 0000000..61f7b9e --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/TapSDKPINVOKE.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2877a29e516394413a51b59b6021dd00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Duration/Wrapper/Window.cs b/Runtime/Internal/Duration/Wrapper/Window.cs new file mode 100644 index 0000000..85e7389 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Window.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace com.taptap.tapsdk.bindings.csharp { + +public class Window : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private bool swigCMemOwnBase; + + internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwnBase = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~Window() { + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwnBase) { + swigCMemOwnBase = false; + PlatformPINVOKE.delete_Window(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } + } + + public static void OnForeground() { + PlatformPINVOKE.Window_OnForeground(); + } + + public static void OnBackground() { + PlatformPINVOKE.Window_OnBackground(); + } + + public Window() : this(PlatformPINVOKE.new_Window(), true) { + } + +} + +} diff --git a/Runtime/Internal/Duration/Wrapper/Window.cs.meta b/Runtime/Internal/Duration/Wrapper/Window.cs.meta new file mode 100644 index 0000000..d554994 --- /dev/null +++ b/Runtime/Internal/Duration/Wrapper/Window.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89927fba3ae0d49918d71a7852ab210a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Http.meta b/Runtime/Internal/Http.meta new file mode 100644 index 0000000..3e3a62e --- /dev/null +++ b/Runtime/Internal/Http.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b13d2bb9bda7a47f1b5852f51bf208b6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Http/TapHttpClient.cs b/Runtime/Internal/Http/TapHttpClient.cs new file mode 100644 index 0000000..b002388 --- /dev/null +++ b/Runtime/Internal/Http/TapHttpClient.cs @@ -0,0 +1,176 @@ +using System; +using System.Linq; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using LC.Newtonsoft.Json; +using TapTap.Common.Internal.Json; + +namespace TapTap.Common.Internal.Http { + public class TapHttpClient { + private readonly string clientId; + + private readonly string clientToken; + + private readonly string serverUrl; + + readonly HttpClient client; + + private Dictionary>> runtimeHeaderTasks = new Dictionary>>(); + + private Dictionary additionalHeaders = new Dictionary(); + + public TapHttpClient(string clientID, string clientToken, string serverUrl) { + this.clientId = clientID; + this.clientToken = clientToken; + this.serverUrl = serverUrl; + + client = new HttpClient(); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + client.DefaultRequestHeaders.Add("X-LC-Id", clientID); + } + + public void AddRuntimeHeaderTask(string key, Func> task) { + if (string.IsNullOrEmpty(key)) { + return; + } + if (task == null) { + return; + } + runtimeHeaderTasks[key] = task; + } + + public void AddAddtionalHeader(string key, string value) { + if (string.IsNullOrEmpty(key)) { + return; + } + if (string.IsNullOrEmpty(value)) { + return; + } + additionalHeaders[key] = value; + } + + public Task Get(string path, + Dictionary headers = null, + Dictionary queryParams = null, + bool withAPIVersion = true) { + return Request(path, HttpMethod.Get, headers, null, queryParams, withAPIVersion); + } + + public Task Post(string path, + Dictionary headers = null, + object data = null, + Dictionary queryParams = null, + bool withAPIVersion = true) { + return Request(path, HttpMethod.Post, headers, data, queryParams, withAPIVersion); + } + + public Task Put(string path, + Dictionary headers = null, + object data = null, + Dictionary queryParams = null, + bool withAPIVersion = true) { + return Request(path, HttpMethod.Put, headers, data, queryParams, withAPIVersion); + } + + public Task Delete(string path, + Dictionary headers = null, + object data = null, + Dictionary queryParams = null, + bool withAPIVersion = true) { + return Request>(path, HttpMethod.Delete, headers, data, queryParams, withAPIVersion); + } + + async Task Request(string path, + HttpMethod method, + Dictionary headers = null, + object data = null, + Dictionary queryParams = null, + bool withAPIVersion = true) { + string url = BuildUrl(path, queryParams); + HttpRequestMessage request = new HttpRequestMessage { + RequestUri = new Uri(url), + Method = method, + }; + await FillHeaders(request.Headers, headers); + + string content = null; + if (data != null) { + content = JsonConvert.SerializeObject(data); + StringContent requestContent = new StringContent(content); + requestContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + request.Content = requestContent; + } + TapHttpUtils.PrintRequest(client, request, content); + HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); + request.Dispose(); + + string resultString = await response.Content.ReadAsStringAsync(); + response.Dispose(); + TapHttpUtils.PrintResponse(response, resultString); + + if (response.IsSuccessStatusCode) { + T ret = JsonConvert.DeserializeObject(resultString, + TapJsonConverter.Default); + return ret; + } + throw HandleErrorResponse(response.StatusCode, resultString); + } + + TapException HandleErrorResponse(HttpStatusCode statusCode, string responseContent) { + int code = (int)statusCode; + string message = responseContent; + try { + // 尝试获取 LeanCloud 返回错误信息 + Dictionary error = JsonConvert.DeserializeObject>(responseContent, + TapJsonConverter.Default); + code = (int)error["code"]; + message = error["error"].ToString(); + } catch (Exception e) { + TapLogger.Error(e); + } + return new TapException(code, message); + } + + string BuildUrl(string path, Dictionary queryParams) { + string apiServer = serverUrl; + StringBuilder urlSB = new StringBuilder(apiServer.TrimEnd('/')); + urlSB.Append($"/{path}"); + string url = urlSB.ToString(); + if (queryParams != null) { + IEnumerable queryPairs = queryParams.Select(kv => $"{kv.Key}={kv.Value}"); + string queries = string.Join("&", queryPairs); + url = $"{url}?{queries}"; + } + return url; + } + + async Task FillHeaders(HttpRequestHeaders headers, Dictionary reqHeaders = null) { + // 额外 headers + if (reqHeaders != null) { + foreach (KeyValuePair kv in reqHeaders) { + headers.Add(kv.Key, kv.Value.ToString()); + } + } + if (additionalHeaders.Count > 0) { + foreach (KeyValuePair kv in additionalHeaders) { + headers.Add(kv.Key, kv.Value); + } + } + // 服务额外 headers + foreach (KeyValuePair>> kv in runtimeHeaderTasks) { + if (headers.Contains(kv.Key)) { + continue; + } + string value = await kv.Value.Invoke(); + if (value == null) { + continue; + } + headers.Add(kv.Key, value); + } + } + } +} diff --git a/Runtime/Internal/Http/TapHttpClient.cs.meta b/Runtime/Internal/Http/TapHttpClient.cs.meta new file mode 100644 index 0000000..6b96b64 --- /dev/null +++ b/Runtime/Internal/Http/TapHttpClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4994de54c069d45b595842ec4e2ff815 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Http/TapHttpUtils.cs b/Runtime/Internal/Http/TapHttpUtils.cs new file mode 100644 index 0000000..359220d --- /dev/null +++ b/Runtime/Internal/Http/TapHttpUtils.cs @@ -0,0 +1,82 @@ +using System; +using System.Linq; +using System.Text; +using System.Collections.Specialized; +using System.Net.Http; + +namespace TapTap.Common.Internal.Http { + public class TapHttpUtils { + public static void PrintRequest(HttpClient client, HttpRequestMessage request, string content = null) { + if (TapLogger.LogDelegate == null) { + return; + } + if (client == null) { + return; + } + if (request == null) { + return; + } + StringBuilder sb = new StringBuilder(); + sb.AppendLine("=== HTTP Request Start ==="); + sb.AppendLine($"URL: {request.RequestUri}"); + sb.AppendLine($"Method: {request.Method}"); + sb.AppendLine($"Headers: "); + foreach (var header in client.DefaultRequestHeaders) { + sb.AppendLine($"\t{header.Key}: {string.Join(",", header.Value.ToArray())}"); + } + foreach (var header in request.Headers) { + sb.AppendLine($"\t{header.Key}: {string.Join(",", header.Value.ToArray())}"); + } + if (request.Content != null) { + foreach (var header in request.Content.Headers) { + sb.AppendLine($"\t{header.Key}: {string.Join(",", header.Value.ToArray())}"); + } + } + if (!string.IsNullOrEmpty(content)) { + sb.AppendLine($"Content: {content}"); + } + sb.AppendLine("=== HTTP Request End ==="); + TapLogger.Debug(sb.ToString()); + } + + public static void PrintResponse(HttpResponseMessage response, string content = null) { + if (TapLogger.LogDelegate == null) { + return; + } + StringBuilder sb = new StringBuilder(); + sb.AppendLine("=== HTTP Response Start ==="); + sb.AppendLine($"URL: {response.RequestMessage.RequestUri}"); + sb.AppendLine($"Status Code: {response.StatusCode}"); + if (!string.IsNullOrEmpty(content)) { + sb.AppendLine($"Content: {content}"); + } + sb.AppendLine("=== HTTP Response End ==="); + TapLogger.Debug(sb.ToString()); + } + + public static NameValueCollection ParseQueryString(string queryString) + { + if (queryString == null) { + throw new ArgumentNullException("queryString"); + } + if (queryString.Length > 0 && queryString[0] == '?') { + queryString = queryString.Substring(1); + } + NameValueCollection queryParameters = new NameValueCollection(); + string[] querySegments = queryString.Split('&'); + foreach(string segment in querySegments) + { + string[] parts = segment.Split('='); + if (parts.Length > 0) + { + string key = parts[0].Trim(new char[] { '?', ' ' }); + string val = parts[1].Trim(); + + queryParameters.Add(key, val); + } + } + + return queryParameters; + } + } +} diff --git a/Runtime/Internal/Http/TapHttpUtils.cs.meta b/Runtime/Internal/Http/TapHttpUtils.cs.meta new file mode 100644 index 0000000..31808a4 --- /dev/null +++ b/Runtime/Internal/Http/TapHttpUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91c6129050459489797755b1c9a40095 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Init.meta b/Runtime/Internal/Init.meta new file mode 100644 index 0000000..243c2bb --- /dev/null +++ b/Runtime/Internal/Init.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9af22420a66ea43ed97581c1a63a2eac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Init/CommonInitTask.cs b/Runtime/Internal/Init/CommonInitTask.cs new file mode 100644 index 0000000..284fa1e --- /dev/null +++ b/Runtime/Internal/Init/CommonInitTask.cs @@ -0,0 +1,10 @@ +namespace TapTap.Common.Internal.Init { + public class CommonInitTask : IInitTask { + public int Order => 1; + + public void Init(TapConfig config) { + TapCommon.Init(config); + UnityMonobehaviorWrapper.Instance.Init(); + } + } +} diff --git a/Runtime/Internal/Init/CommonInitTask.cs.meta b/Runtime/Internal/Init/CommonInitTask.cs.meta new file mode 100644 index 0000000..23bd6b0 --- /dev/null +++ b/Runtime/Internal/Init/CommonInitTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c214c48db4874ed9ab71ac952668695 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Init/IInitTask.cs b/Runtime/Internal/Init/IInitTask.cs new file mode 100644 index 0000000..4811a44 --- /dev/null +++ b/Runtime/Internal/Init/IInitTask.cs @@ -0,0 +1,15 @@ + +namespace TapTap.Common.Internal.Init { + public interface IInitTask { + /// + /// 初始化顺序 + /// + int Order { get; } + + /// + /// 初始化 + /// + /// + void Init(TapConfig config); + } +} diff --git a/Runtime/Internal/Init/IInitTask.cs.meta b/Runtime/Internal/Init/IInitTask.cs.meta new file mode 100644 index 0000000..2908e4c --- /dev/null +++ b/Runtime/Internal/Init/IInitTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41233cd82809e4f93bfa31660dfeb3c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Json.meta b/Runtime/Internal/Json.meta new file mode 100644 index 0000000..a73c862 --- /dev/null +++ b/Runtime/Internal/Json.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 41dfed8ddbbf24a9580a4a825a0e2428 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Json/TapJsonConverter.cs b/Runtime/Internal/Json/TapJsonConverter.cs new file mode 100644 index 0000000..f915164 --- /dev/null +++ b/Runtime/Internal/Json/TapJsonConverter.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using LC.Newtonsoft.Json; + +namespace TapTap.Common.Internal.Json { + public class TapJsonConverter : JsonConverter { + public override bool CanConvert(Type objectType) { + return objectType == typeof(object); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { + serializer.Serialize(writer, value); + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { + if (reader.TokenType == JsonToken.StartObject) { + var obj = new Dictionary(); + serializer.Populate(reader, obj); + return obj; + } + if (reader.TokenType == JsonToken.StartArray) { + var arr = new List(); + serializer.Populate(reader, arr); + return arr; + } + if (reader.TokenType == JsonToken.Integer) { + if ((long)reader.Value < int.MaxValue) { + return Convert.ToInt32(reader.Value); + } + } + if (reader.TokenType == JsonToken.Float) { + return Convert.ToSingle(reader.Value); + } + + return serializer.Deserialize(reader); + } + + public readonly static TapJsonConverter Default = new TapJsonConverter(); + } +} diff --git a/Runtime/Internal/Json/TapJsonConverter.cs.meta b/Runtime/Internal/Json/TapJsonConverter.cs.meta new file mode 100644 index 0000000..af284f6 --- /dev/null +++ b/Runtime/Internal/Json/TapJsonConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad770233e52c24fdfb7ce9a0ee8315b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Platform.meta b/Runtime/Internal/Platform.meta new file mode 100644 index 0000000..c9a6dde --- /dev/null +++ b/Runtime/Internal/Platform.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f79d6f455f7f4082b4656bfd28fccb2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Platform/ITapCommonPlatform.cs b/Runtime/Internal/Platform/ITapCommonPlatform.cs new file mode 100644 index 0000000..3e2041a --- /dev/null +++ b/Runtime/Internal/Platform/ITapCommonPlatform.cs @@ -0,0 +1,48 @@ +using System; +using System.Threading.Tasks; + +namespace TapTap.Common.Internal { + public interface ITapCommonPlatform { + void Init(TapConfig config); + + void GetRegionCode(Action callback); + + void IsTapTapInstalled(Action callback); + + void IsTapTapGlobalInstalled(Action callback); + + void UpdateGameInTapTap(string appId, Action callback); + + void UpdateGameInTapGlobal(string appId, Action callback); + + void OpenReviewInTapTap(string appId, Action callback); + + void OpenReviewInTapGlobal(string appId, Action callback); + + void SetXua(); + + void SetLanguage(TapLanguage language); + + void RegisterProperties(string key, ITapPropertiesProxy proxy); + + void UseNativeDataInCore(bool enable); + + void AddHost(string host, string replaceHost); + + Task UpdateGameAndFailToWebInTapTap(string appId); + + Task UpdateGameAndFailToWebInTapGlobal(string appId); + + Task UpdateGameAndFailToWebInTapTap(string appId, string webUrl); + + Task UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl); + + Task OpenWebDownloadUrlOfTapTap(string appId); + + Task OpenWebDownloadUrlOfTapGlobal(string appId); + + Task OpenWebDownloadUrl(string url); + + void SetDurationStatisticsEnabled(bool enable); + } +} diff --git a/Runtime/Internal/Platform/ITapCommonPlatform.cs.meta b/Runtime/Internal/Platform/ITapCommonPlatform.cs.meta new file mode 100644 index 0000000..07acb4b --- /dev/null +++ b/Runtime/Internal/Platform/ITapCommonPlatform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bed946589a114c839ae06fb9ae2a81d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Platform/PlatformTypeUtils.cs b/Runtime/Internal/Platform/PlatformTypeUtils.cs new file mode 100644 index 0000000..3407a1f --- /dev/null +++ b/Runtime/Internal/Platform/PlatformTypeUtils.cs @@ -0,0 +1,23 @@ +using System; +using System.Linq; + +namespace TapTap.Common.Internal { + public static class PlatformTypeUtils { + /// + /// 创建平台接口实现类对象 + /// + /// + /// + /// + public static object CreatePlatformImplementationObject(Type interfaceType, string startWith) { + Type platformSupportType = AppDomain.CurrentDomain.GetAssemblies() + .Where(asssembly => asssembly.GetName().FullName.StartsWith(startWith)) + .SelectMany(assembly => assembly.GetTypes()) + .SingleOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass); + if (platformSupportType != null) { + return Activator.CreateInstance(platformSupportType); + } + return null; + } + } +} \ No newline at end of file diff --git a/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta b/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta new file mode 100644 index 0000000..10be826 --- /dev/null +++ b/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4dad26fd3373f49378516a2fca6bc845 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI.meta b/Runtime/Internal/UI.meta new file mode 100644 index 0000000..e572041 --- /dev/null +++ b/Runtime/Internal/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1bca99862233644a8b3d9fe1c1346297 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base.meta b/Runtime/Internal/UI/Base.meta new file mode 100644 index 0000000..2e7eedf --- /dev/null +++ b/Runtime/Internal/UI/Base.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b55505382b99946cdac17f40c9c6ee0f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base/Const.cs b/Runtime/Internal/UI/Base/Const.cs new file mode 100644 index 0000000..2996c13 --- /dev/null +++ b/Runtime/Internal/UI/Base/Const.cs @@ -0,0 +1,27 @@ +using System; +namespace TapTap.UI +{ + public enum EOpenMode + { + Sync, + + Async, + } + + [Flags] + public enum EAnimationMode + { + None = 0, + + Alpha = 1 << 0, + + Scale = 1 << 1, + + RightSlideIn = 1 << 2, + + UpSlideIn = 1 << 3, + ToastSlideIn = 1 << 4, + + AlphaAndScale = Alpha | Scale, + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/Const.cs.meta b/Runtime/Internal/UI/Base/Const.cs.meta new file mode 100644 index 0000000..b85e9d8 --- /dev/null +++ b/Runtime/Internal/UI/Base/Const.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4c258ce272494fea981dcbc0dcb3d48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs b/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs new file mode 100644 index 0000000..e44c9cd --- /dev/null +++ b/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Text; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.Serialization; +using UnityEngine.UI; + +namespace TapTap.UI +{ + /// + /// 修复UnityUGui中Canvas画布在Windows平台宽高比过长(横屏拉很长)导致UI的最右边一部分无法被点击的Bug,现发现与2021.3.x版本 + /// + public class GraphicRaycasterBugFixed : GraphicRaycaster + { + [NonSerialized] private List m_RaycastResults = new List(); + private Canvas _Canvas; + private Canvas canvasBugFixed + { + get + { + if (_Canvas != null) + return _Canvas; + + _Canvas = GetComponent(); + return _Canvas; + } + } + /// + /// Perform the raycast against the list of graphics associated with the Canvas. + /// + /// Current event data + /// List of hit objects to append new results to. + public override void Raycast(PointerEventData eventData, List resultAppendList) + { + if (canvasBugFixed == null) + return; + + var canvasGraphics = GraphicRegistry.GetGraphicsForCanvas(canvasBugFixed); + if (canvasGraphics == null || canvasGraphics.Count == 0) + return; + + int displayIndex; + var currentEventCamera = eventCamera; // Property can call Camera.main, so cache the reference + + if (canvasBugFixed.renderMode == RenderMode.ScreenSpaceOverlay || currentEventCamera == null) + displayIndex = canvasBugFixed.targetDisplay; + else + displayIndex = currentEventCamera.targetDisplay; + + //!! 不同之处 + var eventPosition = Display.RelativeMouseAt(eventData.position); + //MultipleDisplayUtilities.RelativeMouseAtScaled(eventData.position); + if (eventPosition != Vector3.zero) + { + // We support multiple display and display identification based on event position. + + int eventDisplayIndex = (int)eventPosition.z; + + // Discard events that are not part of this display so the user does not interact with multiple displays at once. + if (eventDisplayIndex != displayIndex) + return; + } + else + { + // The multiple display system is not supported on all platforms, when it is not supported the returned position + // will be all zeros so when the returned index is 0 we will default to the event data to be safe. + eventPosition = eventData.position; + + // We dont really know in which display the event occured. We will process the event assuming it occured in our display. + } + + // Convert to view space + Vector2 pos; + if (currentEventCamera == null) + { + // Multiple display support only when not the main display. For display 0 the reported + // resolution is always the desktops resolution since its part of the display API, + // so we use the standard none multiple display method. (case 741751) + float w = Screen.width; + float h = Screen.height; + if (displayIndex > 0 && displayIndex < Display.displays.Length) + { + w = Display.displays[displayIndex].systemWidth; + h = Display.displays[displayIndex].systemHeight; + } + pos = new Vector2(eventPosition.x / w, eventPosition.y / h); + } + else + pos = currentEventCamera.ScreenToViewportPoint(eventPosition); + + // If it's outside the camera's viewport, do nothing + if (pos.x < 0f || pos.x > 1f || pos.y < 0f || pos.y > 1f) + return; + + float hitDistance = float.MaxValue; + + Ray ray = new Ray(); + + if (currentEventCamera != null) + ray = currentEventCamera.ScreenPointToRay(eventPosition); + + if (canvasBugFixed.renderMode != RenderMode.ScreenSpaceOverlay && blockingObjects != BlockingObjects.None) + { + float distanceToClipPlane = 100.0f; + + if (currentEventCamera != null) + { + float projectionDirection = ray.direction.z; + distanceToClipPlane = Mathf.Approximately(0.0f, projectionDirection) + ? Mathf.Infinity + : Mathf.Abs((currentEventCamera.farClipPlane - currentEventCamera.nearClipPlane) / projectionDirection); + } + #if PACKAGE_PHYSICS + if (blockingObjects == BlockingObjects.ThreeD || blockingObjects == BlockingObjects.All) + { + if (ReflectionMethodsCache.Singleton.raycast3D != null) + { + var hits = ReflectionMethodsCache.Singleton.raycast3DAll(ray, distanceToClipPlane, (int)m_BlockingMask); + if (hits.Length > 0) + hitDistance = hits[0].distance; + } + } + #endif + #if PACKAGE_PHYSICS2D + if (blockingObjects == BlockingObjects.TwoD || blockingObjects == BlockingObjects.All) + { + if (ReflectionMethodsCache.Singleton.raycast2D != null) + { + var hits = ReflectionMethodsCache.Singleton.getRayIntersectionAll(ray, distanceToClipPlane, (int)m_BlockingMask); + if (hits.Length > 0) + hitDistance = hits[0].distance; + } + } + #endif + } + + m_RaycastResults.Clear(); + + Raycast(canvasBugFixed, currentEventCamera, eventPosition, canvasGraphics, m_RaycastResults); + + int totalCount = m_RaycastResults.Count; + for (var index = 0; index < totalCount; index++) + { + var go = m_RaycastResults[index].gameObject; + bool appendGraphic = true; + + if (ignoreReversedGraphics) + { + if (currentEventCamera == null) + { + // If we dont have a camera we know that we should always be facing forward + var dir = go.transform.rotation * Vector3.forward; + appendGraphic = Vector3.Dot(Vector3.forward, dir) > 0; + } + else + { + // If we have a camera compare the direction against the cameras forward. + var cameraForward = currentEventCamera.transform.rotation * Vector3.forward * currentEventCamera.nearClipPlane; + // !!不同之处 + appendGraphic = Vector3.Dot(go.transform.position - currentEventCamera.transform.position - cameraForward, go.transform.forward) >= 0; + } + } + + if (appendGraphic) + { + float distance = 0; + Transform trans = go.transform; + Vector3 transForward = trans.forward; + + if (currentEventCamera == null || canvasBugFixed.renderMode == RenderMode.ScreenSpaceOverlay) + distance = 0; + else + { + // http://geomalgorithms.com/a06-_intersect-2.html + distance = (Vector3.Dot(transForward, trans.position - ray.origin) / Vector3.Dot(transForward, ray.direction)); + + // Check to see if the go is behind the camera. + if (distance < 0) + continue; + } + + if (distance >= hitDistance) + continue; + + var castResult = new RaycastResult + { + gameObject = go, + module = this, + distance = distance, + screenPosition = eventPosition, + displayIndex = displayIndex, + index = resultAppendList.Count, + depth = m_RaycastResults[index].depth, + sortingLayer = canvasBugFixed.sortingLayerID, + sortingOrder = canvasBugFixed.sortingOrder, + worldPosition = ray.origin + ray.direction * distance, + worldNormal = -transForward + }; + resultAppendList.Add(castResult); + } + } + } + /// + /// Perform a raycast into the screen and collect all graphics underneath it. + /// + [NonSerialized] static readonly List s_SortedGraphics = new List(); + private static void Raycast(Canvas canvas, Camera eventCamera, Vector2 pointerPosition, IList foundGraphics, List results) + { + // Necessary for the event system + int totalCount = foundGraphics.Count; + for (int i = 0; i < totalCount; ++i) + { + Graphic graphic = foundGraphics[i]; + + // -1 means it hasn't been processed by the canvas, which means it isn't actually drawn + if (!graphic.raycastTarget || graphic.canvasRenderer.cull || graphic.depth == -1) + continue; + + if (!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, pointerPosition, eventCamera)) + continue; + + if (eventCamera != null && eventCamera.WorldToScreenPoint(graphic.rectTransform.position).z > eventCamera.farClipPlane) + continue; + + if (graphic.Raycast(pointerPosition, eventCamera)) + { + s_SortedGraphics.Add(graphic); + } + } + + s_SortedGraphics.Sort((g1, g2) => g2.depth.CompareTo(g1.depth)); + totalCount = s_SortedGraphics.Count; + for (int i = 0; i < totalCount; ++i) + results.Add(s_SortedGraphics[i]); + + s_SortedGraphics.Clear(); + } + } +} diff --git a/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta b/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta new file mode 100644 index 0000000..562217b --- /dev/null +++ b/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2035d02fd32941b68c5a0400a11e41fe +timeCreated: 1678941027 \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/LoadingPanelController.cs b/Runtime/Internal/UI/Base/LoadingPanelController.cs new file mode 100644 index 0000000..ee4b2b1 --- /dev/null +++ b/Runtime/Internal/UI/Base/LoadingPanelController.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace TapTap.UI +{ + public class LoadingPanelController : BasePanelController + { + public Transform rotater; + + public float speed = 10; + /// + /// bind ugui components for every panel + /// + protected override void BindComponents() + { + rotater = transform.Find("Image");; + } + + private void Update() + { + if (rotater != null) + { + var localEuler = rotater.localEulerAngles; + var z = rotater.localEulerAngles.z; + z += Time.deltaTime * speed; + rotater.localEulerAngles = new Vector3(localEuler.x, localEuler.y, z); + } + } + } +} diff --git a/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta b/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta new file mode 100644 index 0000000..ca740bd --- /dev/null +++ b/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dbd5c6109fcfe46a6acf800615f84b0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base/MonoSingleton.cs b/Runtime/Internal/UI/Base/MonoSingleton.cs new file mode 100644 index 0000000..bbd6739 --- /dev/null +++ b/Runtime/Internal/UI/Base/MonoSingleton.cs @@ -0,0 +1,102 @@ +using System; +using UnityEngine; + +namespace TapTap.UI +{ + public class MonoSingleton : MonoBehaviour where T : Component + { + private static T _instance; + + public static T Instance + { + get + { + if (_instance == null && Application.isPlaying) + { + CreateInstance(); + } + + return _instance; + } + } + + private static void CreateInstance() + { + Type theType = typeof(T); + + _instance = (T)FindObjectOfType(theType); + + if (_instance == null) + { + var go = new GameObject(typeof(T).Name); + _instance = go.AddComponent(); + + GameObject rootObj = GameObject.Find("TapSDKSingletons"); + if (rootObj == null) + { + rootObj = new GameObject("TapSDKSingletons"); + DontDestroyOnLoad(rootObj); + } + + go.transform.SetParent(rootObj.transform); + } + } + + public static void DestroyInstance() + { + if (_instance != null) + { + Destroy(_instance.gameObject); + } + } + + public static bool HasInstance() + { + return _instance != null; + } + + protected virtual void Awake() + { + if (_instance != null && _instance.gameObject != gameObject) + { + if (Application.isPlaying) + { + Destroy(gameObject); + } + else + { + DestroyImmediate(gameObject); // UNITY_EDITOR + } + + return; + } + else if (_instance == null) + { + _instance = GetComponent(); + } + + DontDestroyOnLoad(gameObject); + + Init(); + } + + protected virtual void OnDestroy() + { + Uninit(); + + if (_instance != null && _instance.gameObject == gameObject) + { + _instance = null; + } + } + + public virtual void Init() + { + } + + public virtual void Uninit() + { + } + + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/MonoSingleton.cs.meta b/Runtime/Internal/UI/Base/MonoSingleton.cs.meta new file mode 100644 index 0000000..370dd83 --- /dev/null +++ b/Runtime/Internal/UI/Base/MonoSingleton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f59854d639084b21b7d8f5fc3cb8994 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base/Singleton.cs b/Runtime/Internal/UI/Base/Singleton.cs new file mode 100644 index 0000000..c86879d --- /dev/null +++ b/Runtime/Internal/UI/Base/Singleton.cs @@ -0,0 +1,29 @@ +using System; + +namespace TapTap.UI +{ + public class Singleton where T : class + { + private static T _instance; + private static readonly object _lock = new object(); + + public static T Instance + { + get + { + if (_instance == null) + { + lock (_lock) + { + if (_instance == null) + { + _instance = (T)Activator.CreateInstance(typeof(T), true); + } + } + } + + return _instance; + } + } + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/Singleton.cs.meta b/Runtime/Internal/UI/Base/Singleton.cs.meta new file mode 100644 index 0000000..b74ceb3 --- /dev/null +++ b/Runtime/Internal/UI/Base/Singleton.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 72a44edb1518346a190668972f2f58f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base/TipPanelController.cs b/Runtime/Internal/UI/Base/TipPanelController.cs new file mode 100644 index 0000000..1c68f78 --- /dev/null +++ b/Runtime/Internal/UI/Base/TipPanelController.cs @@ -0,0 +1,45 @@ +using System; +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI +{ + public class TipPanelOpenParam : AbstractOpenPanelParameter + { + public string text; + + public Color textColor; + + public TextAnchor textAnchor; + + public TipPanelOpenParam(string text, Color textColor, TextAnchor textAnchor) + { + this.text = text; + this.textColor = textColor; + this.textAnchor = textAnchor; + } + } + public class TipPanelController : BasePanelController + { + public Text text; + + protected override void BindComponents() + { + base.BindComponents(); + text = transform.Find("Text").GetComponent(); + } + + protected override void OnLoadSuccess() + { + base.OnLoadSuccess(); + TipPanelOpenParam param = this.openParam as TipPanelOpenParam; + if (param != null) + { + text.text = param.text; + text.color = param.textColor; + text.alignment = param.textAnchor; + } + } + + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/TipPanelController.cs.meta b/Runtime/Internal/UI/Base/TipPanelController.cs.meta new file mode 100644 index 0000000..3ee900c --- /dev/null +++ b/Runtime/Internal/UI/Base/TipPanelController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ba2c34ac15964d3ba411eaaaddfe2989 +timeCreated: 1690867588 \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/ToastBlackPanelController.cs b/Runtime/Internal/UI/Base/ToastBlackPanelController.cs new file mode 100644 index 0000000..8814ae0 --- /dev/null +++ b/Runtime/Internal/UI/Base/ToastBlackPanelController.cs @@ -0,0 +1,95 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI { + public class ToastPanelOpenParam : AbstractOpenPanelParameter { + public float popupTime; + + public string text; + + public Texture icon; + + public ToastPanelOpenParam(string text, float popupTime, Texture icon = null) { + this.text = text; + this.popupTime = popupTime; + this.icon = icon; + } + } + + public class ToastBlackPanelController : BasePanelController { + private const int MAX_CHAR_COUNT = 87; + private const float MIN_HORIZONTAL_LENGTH = 210; + private const float MAX_HORIZONTAL_LENGTH = 1252; + [HideInInspector] + public Text text; + [HideInInspector] + public RectTransform background; + [HideInInspector] + public LayoutGroup layout; + [HideInInspector] + public RawImage iconImage; + + public float fixVal; + + public float animationTime; + + [SerializeField] + private float sizeDeltaX = 50f; + + protected override void BindComponents() { + base.BindComponents(); + background = transform.Find("Root/BGM") as RectTransform; + layout = background.transform.Find("Container").GetComponent(); + text = layout.transform.Find("Text").GetComponent(); + iconImage = layout.transform.Find("Mask/Icon").GetComponent(); + fadeAnimationTime = animationTime; + } + + protected override void OnLoadSuccess() { + base.OnLoadSuccess(); + ToastPanelOpenParam param = this.openParam as ToastPanelOpenParam; + if (param != null) { + + iconImage.gameObject.SetActive(param.icon != null); + layout.enabled = param.icon != null; + text.text = param.text; + bool overflow; + // test: 已登录账号:海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边边... + var totalLength = CalculateLengthOfText(out overflow); + if (overflow) { + bool haveIcon = param.icon != null; + int length = Mathf.Min(MAX_CHAR_COUNT - (haveIcon ? 4 : 0), param.text.Length - 1); + var transformedText = param.text.Substring(0, length) + "..."; + text.text = transformedText; + } + var x = totalLength; + var y = background.sizeDelta.y; + background.sizeDelta = new Vector2(x, y); + var textRect = text.transform as RectTransform; + + if (param.icon != null) { + iconImage.texture = param.icon; + text.alignment = TextAnchor.MiddleLeft; + textRect.sizeDelta = new Vector2(x - sizeDeltaX, 24); + } + else { + text.alignment = TextAnchor.MiddleCenter; + textRect.anchoredPosition = Vector2.zero; + textRect.anchorMin = Vector2.zero; + textRect.anchorMax = Vector2.one; + textRect.sizeDelta = Vector2.zero; + } + this.Invoke("Close", param.popupTime); + } + } + + protected float CalculateLengthOfText( out bool horizontalOverflow) { + var width = text.preferredWidth + fixVal + 12; + width = Mathf.Max(MIN_HORIZONTAL_LENGTH, width); + var maxWidth = MAX_HORIZONTAL_LENGTH; + horizontalOverflow = width > maxWidth; + width = Mathf.Min(maxWidth, width); + return width; + } + } +} diff --git a/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta b/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta new file mode 100644 index 0000000..7a408c4 --- /dev/null +++ b/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d976458a47d90410fa1669caf419e0fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Base/ToastWhitePanelController.cs b/Runtime/Internal/UI/Base/ToastWhitePanelController.cs new file mode 100644 index 0000000..8d4f1f3 --- /dev/null +++ b/Runtime/Internal/UI/Base/ToastWhitePanelController.cs @@ -0,0 +1,79 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI { + public class ToastWhitePanelController : BasePanelController { + private const int MAX_CHAR_COUNT = 69; + private const float MIN_HORIZONTAL_LENGTH = 120; + private const float MAX_HORIZONTAL_LENGTH = 1252; + private const float BACKGROUND_WIDTH_HELPER = 60; + [HideInInspector] + public Text text; + [HideInInspector] + public RectTransform background; + [HideInInspector] + public RawImage iconImage; + + public float fixVal; + + public float animationTime; + + public ToastPanelOpenParam toastParam; + + protected override void BindComponents() { + base.BindComponents(); + background = transform.Find("Root/BGM") as RectTransform; + text = background.transform.Find("Container/Text").GetComponent(); + iconImage = background.transform.Find("Container/Image").GetComponent(); + fadeAnimationTime = animationTime; + } + + protected override void OnLoadSuccess() { + base.OnLoadSuccess(); + ToastPanelOpenParam param = this.openParam as ToastPanelOpenParam; + toastParam = param; + if (param != null) { + iconImage.gameObject.SetActive(param.icon != null); + text.text = param.text; + bool overflow = text.text.Length > MAX_CHAR_COUNT; + // test: 已登录账号:海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边晒太阳海绵宝宝和派大星一起在海边边... + var totalLength = CalculateLengthOfText(); + if (overflow) { + bool haveIcon = param.icon != null; + int length = Mathf.Min(MAX_CHAR_COUNT - (haveIcon ? 4 : 0), param.text.Length - 1); + var transformedText = param.text.Substring(0, length) + "..."; + text.text = transformedText; + } + var x = totalLength; + var y = background.sizeDelta.y; + background.sizeDelta = new Vector2(x + BACKGROUND_WIDTH_HELPER, y); + var textRect = text.transform as RectTransform; + + if (param.icon != null) { + iconImage.texture = param.icon; + textRect.sizeDelta = new Vector2(x, y); + } + else { + textRect.anchoredPosition = Vector2.zero; + textRect.anchorMin = Vector2.zero; + textRect.anchorMax = Vector2.one; + textRect.sizeDelta = Vector2.zero; + } + this.Invoke("Close", param.popupTime); + } + } + + private float CalculateLengthOfText() { + var width = text.preferredWidth + fixVal; + width = Mathf.Max(MIN_HORIZONTAL_LENGTH, width); + var maxWidth = MAX_HORIZONTAL_LENGTH; + width = Mathf.Min(maxWidth, width); + return width; + } + + public void Refresh(float refreshTime) { + this.CancelInvoke("Close"); + this.Invoke("Close", refreshTime); + } + } +} diff --git a/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta b/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta new file mode 100644 index 0000000..5ac3e27 --- /dev/null +++ b/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c78c6db6db8846db9178431b30e1c8a0 +timeCreated: 1695367197 \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/UIManager.cs b/Runtime/Internal/UI/Base/UIManager.cs new file mode 100644 index 0000000..5678ddd --- /dev/null +++ b/Runtime/Internal/UI/Base/UIManager.cs @@ -0,0 +1,724 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI +{ + public class UIManager : MonoSingleton + { + public enum GeneralToastLevel { + None = 0, + Info = 1, + Warning = 2, + Error = 3, + Success =4, + } + + private class ToastConfig { + public bool white; + public string text; + public float popupTime; + public Texture icon; + } + + private static Texture whiteToastSuccessIcon; + private static Texture whiteToastErrorIcon; + private static Texture whiteToastInfoIcon; + private static Texture whiteToastWarningIcon; + private static Texture taptapToastIcon; + + public static Texture WhiteToastSuccessIcon { + get { + if (whiteToastSuccessIcon == null) + whiteToastSuccessIcon = UnityEngine.Resources.Load("taptap-toast-success"); + return whiteToastSuccessIcon; + } + } + + public static Texture WhiteToastErrorIcon { + get { + if (whiteToastErrorIcon == null) + whiteToastErrorIcon = UnityEngine.Resources.Load("taptap-toast-error"); + return whiteToastErrorIcon; + } + } + + public static Texture WhiteToastWarningIcon { + get { + if (whiteToastWarningIcon == null) + whiteToastWarningIcon = UnityEngine.Resources.Load("taptap-toast-warning"); + return whiteToastWarningIcon; + } + } + + public static Texture WhiteToastInfoIcon { + get { + if (whiteToastInfoIcon == null) + whiteToastInfoIcon = UnityEngine.Resources.Load("taptap-toast-info"); + return whiteToastInfoIcon; + } + } + + public static Texture TapTapToastIcon { + get { + if (taptapToastIcon == null) + taptapToastIcon = Resources.Load("TapSDKCommonTapIcon"); + return taptapToastIcon; + } + } + + private List _toastCacheData = new List(12); + public const int TOPPEST_SORTING_ORDER = 32767; + + private const int LOADING_PANEL_SORTING_ORDER = TOPPEST_SORTING_ORDER; + + private const int TOAST_PANEL_SORTING_ORDER = TOPPEST_SORTING_ORDER - 10; + private const int TIP_PANEL_SORTING_ORDER = TOPPEST_SORTING_ORDER - 20; + + private const int REFERENCE_WIDTH = 1920; + private const int REFERENCE_HEIGHT = 1080; + + private readonly Dictionary _registerPanels = new Dictionary(); + + // uicamera + private Camera _uiCamera; + + private GameObject _uiRoot; + private GameObject _uiConstantRoot; + private Canvas _uiRootCanvas; + + public Camera UiCamera => _uiCamera; + + public override void Init() + { + if (_uiRoot == null && Application.isPlaying) + { + CreateUIRoot(); + } + } + + private void CreateUIRoot() + { + _uiRoot = Instantiate(Resources.Load("TapSDKUIRoot")); + DontDestroyOnLoad(_uiRoot); + var canvas = _uiRoot.GetComponent(); + _uiCamera = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? Camera.main : canvas.worldCamera; + _uiRoot.transform.SetParent(UIManager.Instance.transform); + _uiRootCanvas = _uiRoot.transform.GetComponent(); + + CanvasScaler scaler = _uiRoot.GetComponent(); + scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; + scaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight; + scaler.referenceResolution = new Vector2(REFERENCE_WIDTH, REFERENCE_HEIGHT); + float referenceRatio = REFERENCE_WIDTH * 1.0f / REFERENCE_HEIGHT; + float screenRatio = Screen.width * 1.0f / Screen.height; + scaler.matchWidthOrHeight = screenRatio > referenceRatio ? 1 : 0; + + _uiConstantRoot = Instantiate(Resources.Load("TapSDKConstantUIRoot")); + DontDestroyOnLoad(_uiConstantRoot); + canvas = _uiConstantRoot.GetComponent(); + _uiCamera = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? Camera.main : canvas.worldCamera; + _uiConstantRoot.transform.SetParent(UIManager.Instance.transform); + _uiRootCanvas = _uiConstantRoot.transform.GetComponent(); + } + + public override void Uninit() + { + _uiCamera = null; + _uiRoot = null; + _uiConstantRoot = null; + _uiRootCanvas = null; + base.Uninit(); + } + + /// + /// Get Or Create UI asynchronously + /// + /// the prefab path + /// opening param + /// if u want to get ui do something,here is for u, which is invoked after BasePanelController.OnLoadSuccess + /// + /// get panel instance if sync mode load + public async Task OpenUIAsync(string path, AbstractOpenPanelParameter param = null, Action onAsyncGet = null) where TPanelController : BasePanelController + { + var basePanelController = GetUI(); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (!basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + onAsyncGet?.Invoke(basePanelController); + + return basePanelController; + } + + ResourceRequest request = Resources.LoadAsync(path); + while (request.isDone == false) + { + await Task.Yield(); + } + + GameObject go = request.asset as GameObject; + var basePanel = Instantiate(go).GetComponent(); + if (basePanel != null) + { + var prefabRectTransform = basePanel.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + InternalOnPanelLoaded(typeof(TPanelController), basePanel, param); + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + onAsyncGet?.Invoke(basePanel); + + EnsureSpecialPanel(); + return basePanel; + } + else + { + return null; + } + } + + /// + /// Get Or Create UI asynchronously + /// + /// the panel Type + /// the prefab path + /// opening param + /// if u want to get ui do something,here is for u, which is invoked after BasePanelController.OnLoadSuccess + /// get panel instance if sync mode load + public async Task OpenUIAsync(Type panelType, string path, AbstractOpenPanelParameter param = null, Action onAsyncGet = null) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return null; + } + var basePanelController = GetUI(panelType); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (!basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + onAsyncGet?.Invoke(basePanelController); + + return basePanelController; + } + + ResourceRequest request = Resources.LoadAsync(path); + while (request.isDone == false) + { + await Task.Yield(); + } + + GameObject go = request.asset as GameObject; + var basePanel = Instantiate(go).GetComponent(); + if (basePanel != null) + { + var prefabRectTransform = basePanel.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + InternalOnPanelLoaded(panelType, basePanel, param); + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + onAsyncGet?.Invoke(basePanel); + + EnsureSpecialPanel(); + return basePanel; + } + else + { + return null; + } + } + + /// + /// Get Or Create UI + /// + /// the prefab path + /// opening param + /// + /// get panel instance if sync mode load + public TPanelController OpenUI(string path, AbstractOpenPanelParameter param = null) where TPanelController : BasePanelController + { + TPanelController basePanelController = GetUI(); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (!basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + return basePanelController; + } + + var go = Resources.Load(path) as GameObject; + if (go != null) + { + var prefabRectTransform = go.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + GameObject panelGo = GameObject.Instantiate(go); + + var basePanel = panelGo.GetComponent(); + if (basePanel == null) { + basePanel = panelGo.AddComponent(); + } + _registerPanels.Add(typeof(TPanelController), basePanel); + + basePanel.transform.SetAsLastSibling(); + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + + basePanel.OnLoaded(param); + + EnsureSpecialPanel(); + return basePanel; + } + return null; + } + + /// + /// Get Or Create UI + /// + /// panel type MUST based on BasePanelController + /// the prefab path + /// opening param + /// get panel instance if sync mode load + public BasePanelController OpenUI(Type panelType, string path, AbstractOpenPanelParameter param = null) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return null; + } + var basePanelController = GetUI(panelType); + + // 如果已有界面(之前缓存过的),则不执行任何操作 + if (basePanelController != null) + { + if (basePanelController != null && !basePanelController.canvas.enabled) + { + basePanelController.canvas.enabled = true; + } + + return basePanelController; + } + + var panelGo = Resources.Load(path) as GameObject; + if (panelGo != null) + { + var prefabRectTransform = panelGo.transform as RectTransform; + var anchorMin = prefabRectTransform.anchorMin; + var anchorMax = prefabRectTransform.anchorMax; + var anchoredPosition = prefabRectTransform.anchoredPosition; + var sizeDelta = prefabRectTransform.sizeDelta; + + var basePanel = GameObject.Instantiate(panelGo).GetComponent(); + + _registerPanels.Add(panelType, basePanel); + + // basePanel.SetOpenOrder(uiOpenOrder); + basePanel.transform.SetAsLastSibling(); + + if (IsNeedCorrectRectTransform(basePanel)) + { + var panelRectTransform = basePanel.transform as RectTransform; + panelRectTransform.anchorMin = anchorMin; + panelRectTransform.anchorMax = anchorMax; + panelRectTransform.anchoredPosition = anchoredPosition; + panelRectTransform.sizeDelta = sizeDelta; + } + basePanel.OnLoaded(param); + + EnsureSpecialPanel(); + return basePanel; + } + return null; + } + + public BasePanelController GetUI(Type panelType) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return null; + } + + if (_registerPanels.TryGetValue(panelType, out BasePanelController basePanelController)) + { + return basePanelController; + } + + return null; + } + + public TPanelController GetUI() where TPanelController : BasePanelController + { + Type panelType = typeof(TPanelController); + + if (_registerPanels.TryGetValue(panelType, out BasePanelController panel)) + { + return (TPanelController)panel; + } + + return null; + } + + public bool CloseUI(Type panelType) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return false; + } + BasePanelController baseController = GetUI(panelType); + if (baseController != null) + { + if (panelType == typeof(BasePanelController)) // 标尺界面是测试界面 不用关闭 + return false; + else + baseController.Close(); + return true; + } + return false; + } + + public bool CloseUI() where TPanelController : BasePanelController + { + TPanelController panel = GetUI(); + if (panel != null) + { + panel.Close(); + return true; + } + return false; + } + + /// + /// add ui would invoked after create ui automatically, don't need mannually call it in most case + /// + public void AddUI(BasePanelController panel) + { + if (panel == null) + { + return; + } + var rt = panel.transform as RectTransform; + Vector2 cacheAP = Vector2.zero; + Vector2 cacheOffsetMax = Vector2.zero; + Vector2 cacheOffsetMin = Vector2.zero; + Vector2 cacheSizeDelta = Vector2.zero; + if (rt != null) + { + cacheAP = rt.anchoredPosition; + cacheOffsetMax = rt.offsetMax; + cacheOffsetMin = rt.offsetMin; + cacheSizeDelta = rt.sizeDelta; + } + panel.transform.SetParent(panel.AttachedParent); + if (rt != null) + { + rt.anchoredPosition = cacheAP; + rt.offsetMax = cacheOffsetMax; + rt.offsetMin = cacheOffsetMin; + rt.sizeDelta = cacheSizeDelta; + } + panel.transform.localScale = Vector3.one; + panel.transform.localRotation = Quaternion.identity; + panel.gameObject.name = panel.gameObject.name.Replace("(Clone)", ""); + } + + /// + /// remove ui would invoked automatically, don't need mannually call it in most case + /// + public void RemoveUI(BasePanelController panel) + { + if (panel == null) + { + return; + } + Type panelType = panel.GetType(); + if (_registerPanels.ContainsKey(panelType)) + { + _registerPanels.Remove(panelType); + } + + if (panelType == typeof(ToastBlackPanelController) || panelType == typeof(ToastWhitePanelController)) { + CheckToastCache(); + } + + panel.Dispose(); + } + + private void CheckToastCache() { + if (_toastCacheData.Count > 0) { + var config = _toastCacheData[0]; + InternalOpenToast(config.white, config.text, config.popupTime, config.icon); + _toastCacheData.RemoveAt(0); + } + } + + /// + /// take some ui to the most top layer + /// + /// + public void ToppedUI(Type panelType) + { + if (!typeof(BasePanelController).IsAssignableFrom(panelType)) + { + return; + } + ToppedUI(GetUI(panelType)); + } + + /// + /// take some ui to the most top layer + /// + /// + /// 特殊 UI(Loading,Toast之类) 是否需要重新制定 + public void ToppedUI(BasePanelController panel, bool toppedSepcialUI = true) + { + if (panel == null) + { + return; + } + + // panel.SetOpenOrder(uiOpenOrder); + panel.transform.SetAsLastSibling(); + if (toppedSepcialUI) EnsureSpecialPanel(); + } + + /// + /// open toast panel for tip info + /// + public void OpenToast(bool white, string text, float popupTime = 3.0f, Texture icon = null) { + // print this function parameters + if (!string.IsNullOrEmpty(text) && popupTime > 0) { + bool isShowing = GetUI() != null || GetUI() != null; + if (ToastTryMerge(white, text, popupTime, icon)) { + return; + } + if (isShowing) { + var config = new ToastConfig() { + white = white, + text = text, + popupTime = popupTime, + icon = icon, + }; + _toastCacheData.Add(config); + } + else { + InternalOpenToast(white, text, popupTime, icon); + } + } + } + + private bool ToastTryMerge(bool white, string text, float popupTime, Texture icon) { + var currentToastPanel = GetUI(); + if (currentToastPanel?.toastParam != null) { + var param = currentToastPanel?.toastParam; + // 目前只有白色 Toast 进行 Merge + bool sameToast = param.icon == icon && param.text == text && white; + if (sameToast) { + currentToastPanel.Refresh(popupTime); + return true; + } + } + + return false; + } + + /// + /// 打开通用 Toast(白色底) + /// + /// + /// 设置 Toast 提示级别,会展示提示图片,如果不想要提示图片,请使用 GeneralToastLevel.None + /// + public void OpenToast(string text, GeneralToastLevel toastLevel, float popupTime = 3.0f) { + OpenToast(true, text, popupTime, GetToastIcon(toastLevel)); + } + + private Texture GetToastIcon(GeneralToastLevel toastLevel) { + if (toastLevel == GeneralToastLevel.None) + return null; + switch (toastLevel) { + case GeneralToastLevel.Info: + return UIManager.WhiteToastInfoIcon; + case GeneralToastLevel.Warning: + return UIManager.WhiteToastWarningIcon; + case GeneralToastLevel.Error: + return UIManager.WhiteToastErrorIcon; + case GeneralToastLevel.Success: + return UIManager.WhiteToastSuccessIcon; + } + + return null; + } + + private void InternalOpenToast(bool white, string text, float popupTime, Texture icon) { + if (string.IsNullOrEmpty(text) || popupTime <= 0) return; + if (white) { + var toast = OpenUI("TapCommonToastWhite", new ToastPanelOpenParam(text, popupTime, icon)); + if (toast != null) { + toast.transform.SetAsLastSibling(); + } + } + else { + var toast = OpenUI("TapCommonToastBlack", new ToastPanelOpenParam(text, popupTime, icon)); + if (toast != null) { + toast.transform.SetAsLastSibling(); + } + } + } + + /// + /// open toast panel for tip info + /// + public void OpenTip(string text, Color textColor, TextAnchor textAnchor = TextAnchor.MiddleCenter) + { + if (!string.IsNullOrEmpty(text)) + { + Debug.LogFormat($"[UIManager] Call OpenTip text:{text} "); + var tip = OpenUI("TapCommonTip", new TipPanelOpenParam(text, textColor, textAnchor)); + if (tip != null) + { + tip.transform.SetAsLastSibling(); + } + } + } + + /// + /// open loading panel that would at the toppest layer and block interaction + /// + public void OpenLoading() + { + var loadingPanel = OpenUI("Loading"); + if (loadingPanel != null) + { + // https://www.reddit.com/r/Unity3D/comments/2b1g1l/order_in_layer_maximum_value/ + // loadingPanel.SetOpenOrder(LOADING_PANEL_SORTING_ORDER); + loadingPanel.transform.SetAsLastSibling(); + } + } + + /// + /// open loading panel that would at the toppest layer and block interaction + /// + public async Task OpenLoadingAsync() + { + var loadingPanel = await OpenUIAsync("Loading"); + if (loadingPanel != null) + { + // https://www.reddit.com/r/Unity3D/comments/2b1g1l/order_in_layer_maximum_value/ + // loadingPanel.SetOpenOrder(LOADING_PANEL_SORTING_ORDER); + loadingPanel.transform.SetAsLastSibling(); + } + } + + public void CloseLoading() + { + var loadingPanel = GetUI(); + if (loadingPanel != null) + { + loadingPanel.Close(); + } + } + + public void CloseTip() + { + var panel = GetUI(); + if (panel != null) + { + panel.Close(); + } + } + + private bool IsNeedCorrectRectTransform(BasePanelController controller) + { + if (controller == null) return false; + return (controller.panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.None; + } + + private void InternalOnPanelLoaded(Type tPanelController, BasePanelController basePanel, AbstractOpenPanelParameter param = null) + { + _registerPanels.Add(tPanelController, basePanel); + + basePanel.OnLoaded(param); + + // basePanel.SetOpenOrder(uiOpenOrder); + + basePanel.transform.SetAsLastSibling(); + } + + private void EnsureSpecialPanel() + { + var temp = _registerPanels.Where(panel => + panel.Value != null && panel.Value.gameObject.activeInHierarchy && panel.Value.toppedOrder != 0); + var toppedPanels = new List>(temp); + if (toppedPanels.Count == 0) return; + toppedPanels.Sort((x,y)=>x.Value.toppedOrder.CompareTo(y.Value.toppedOrder)); + foreach (var toppedPanel in toppedPanels) + { + toppedPanel.Value.transform.SetAsLastSibling(); + } + } + + public Transform GetUIRootTransform(BasePanelController panel) + { + if (panel?.openParam != null && panel.openParam.NeedConstantResolution) + return _uiConstantRoot.transform; + else + return _uiRoot.transform; + } + + + #region external api + public void SetSortOrder(int order) + { + _uiRootCanvas.sortingOrder = order; + } + + public Camera GetUICamera() + { + return _uiCamera; + } + #endregion + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Base/UIManager.cs.meta b/Runtime/Internal/UI/Base/UIManager.cs.meta new file mode 100644 index 0000000..217590e --- /dev/null +++ b/Runtime/Internal/UI/Base/UIManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5605d28bde3d14bbeb7903ccb50ae6cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/BasePanel.meta b/Runtime/Internal/UI/BasePanel.meta new file mode 100644 index 0000000..151c603 --- /dev/null +++ b/Runtime/Internal/UI/BasePanel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f72fc0aa3c0e04243afa27ea15d1693f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/BasePanel/BasePanelController.cs b/Runtime/Internal/UI/BasePanel/BasePanelController.cs new file mode 100644 index 0000000..987dfcc --- /dev/null +++ b/Runtime/Internal/UI/BasePanel/BasePanelController.cs @@ -0,0 +1,385 @@ +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +namespace TapTap.UI +{ + /// + /// base panel of TapSDK UI module + /// + [RequireComponent(typeof(CanvasGroup))] + [RequireComponent(typeof(GraphicRaycaster))] + public abstract class BasePanelController : MonoBehaviour + { + protected virtual float GetToastSlideInOffset() => 300; + /// + /// the canvas related to this panel + /// + [HideInInspector] + public Canvas canvas; + + /// + /// the canvas group related to this panel + /// + [HideInInspector] + public CanvasGroup canvasGroup; + + /// + /// fade in/out time + /// + protected float fadeAnimationTime = 0.15f; + + /// + /// animation elapse time + /// + private float _animationElapse; + + private Vector2 _screenSize; + private Vector2 _cachedAnchorPos; + + private RectTransform _rectTransform; + + private Coroutine _animationCoroutine; + + /// + /// open parameter + /// + protected internal AbstractOpenPanelParameter openParam; + + /// + /// settings about this panel + /// + public BasePanelConfig panelConfig; + + /// + /// 特殊面板需要一直保持置顶的,需要填写 toppedOrder, toppedOrder 越大越置顶 + /// + public int toppedOrder; + + /// + /// the transform parent when created it would be attached to + /// + /// + public virtual Transform AttachedParent => UIManager.Instance.GetUIRootTransform(this); + + #region Load + protected virtual void Awake() + { + canvas = GetComponent(); + canvasGroup = GetComponent(); + _rectTransform = transform as RectTransform; + + _screenSize = new Vector2(Screen.width, Screen.height); + + #if UNITY_EDITOR + if (canvas == null) + { + Debug.LogErrorFormat("[TapSDK UI] BasePanel Must Be Related To Canvas Component!"); + } + #endif + } + + /// + /// bind ugui components for every panel + /// + protected virtual void BindComponents() {} + + /// + /// create the prefab instance + /// + /// + public void OnLoaded(AbstractOpenPanelParameter param = null) + { + openParam = param; + // 寻找组件 + BindComponents(); + + // 添加到控制层 + UIManager.Instance.AddUI(this); + + // 更新层级信息 + InitCanvasSetting(); + // 开始动画效果 + OnShowEffectStart(); + + // 调用加载成功方法 + OnLoadSuccess(); + } + + private void InitCanvasSetting() + { + if (canvas.renderMode != RenderMode.ScreenSpaceOverlay) + { + var camera = UIManager.Instance.GetUICamera(); + if (camera != null) + { + canvas.worldCamera = camera; + } + } + + canvas.pixelPerfect = true; + // canvas.overrideSorting = true; + } + + /// + /// init panel logic here + /// + protected virtual void OnLoadSuccess() + { + + } + + #endregion + + #region Animation + + protected virtual void OnShowEffectStart() + { + if (panelConfig.animationType == EAnimationMode.None) + { + return; + } + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 0; + } + + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.zero; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _cachedAnchorPos = _rectTransform.anchoredPosition; + _rectTransform.anchoredPosition += new Vector2(_screenSize.x, 0); + } + + if ((panelConfig.animationType & EAnimationMode.UpSlideIn) == EAnimationMode.UpSlideIn) { + _cachedAnchorPos = _rectTransform.anchoredPosition; + _rectTransform.anchoredPosition += new Vector2(0, _screenSize.y); + } + + if ((panelConfig.animationType & EAnimationMode.ToastSlideIn) == EAnimationMode.ToastSlideIn) { + _cachedAnchorPos = _rectTransform.anchoredPosition; + _rectTransform.anchoredPosition += new Vector2(0, GetToastSlideInOffset()); + } + OnEffectStart(); + _animationCoroutine = StartCoroutine(FadeInCoroutine(fadeAnimationTime)); + } + + protected virtual void OnShowEffectEnd() + { + OnEffectEnd(); + } + + protected virtual void OnCloseEffectStart() + { + OnEffectStart(); + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 1; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.one; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + if ((panelConfig.animationType & EAnimationMode.UpSlideIn) == EAnimationMode.UpSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + if ((panelConfig.animationType & EAnimationMode.ToastSlideIn) == EAnimationMode.ToastSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + _animationCoroutine = StartCoroutine(FadeOutCoroutine(fadeAnimationTime)); + } + + protected virtual void OnCloseEffectEnd() + { + OnEffectEnd(); + GameObject.Destroy(gameObject); + } + + private void OnEffectStart() + { + _animationElapse = 0; + if (_animationCoroutine != null) + { + StopCoroutine(_animationCoroutine); + _animationCoroutine = null; + } + canvasGroup.interactable = false; + } + + private void OnEffectEnd() + { + canvasGroup.interactable = true; + _animationElapse = 0; + _animationCoroutine = null; + } + + private IEnumerator FadeInCoroutine(float time) + { + while (_animationElapse < time) + { + yield return null; + _animationElapse += Time.deltaTime; + float value = Mathf.Clamp01(_animationElapse / time); + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = value; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = new Vector3(value, value, value); + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + var temp = (1 - value) * _screenSize.x; + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x + temp, _cachedAnchorPos.y); + } + if ((panelConfig.animationType & EAnimationMode.UpSlideIn) == EAnimationMode.UpSlideIn) + { + var temp = (1 - value) * _screenSize.y; + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x, _cachedAnchorPos.y + + temp); + } + if ((panelConfig.animationType & EAnimationMode.ToastSlideIn) == EAnimationMode.ToastSlideIn) + { + var temp = (1 - value) * GetToastSlideInOffset(); + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x, _cachedAnchorPos.y + + temp); + } + } + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 1; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.one; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + if ((panelConfig.animationType & EAnimationMode.UpSlideIn) == EAnimationMode.UpSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + if ((panelConfig.animationType & EAnimationMode.ToastSlideIn) == EAnimationMode.ToastSlideIn) + { + _rectTransform.anchoredPosition = _cachedAnchorPos; + } + + OnShowEffectEnd(); + } + + private IEnumerator FadeOutCoroutine(float time) + { + while (_animationElapse < time) + { + yield return null; + _animationElapse += Time.deltaTime; + float value = 1 - Mathf.Clamp01(_animationElapse / time); + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = value; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = new Vector3(value, value, value); + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + var temp = (1 - value) * _screenSize.x; + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x + temp, _cachedAnchorPos.y); + } + if ((panelConfig.animationType & EAnimationMode.UpSlideIn) == EAnimationMode.UpSlideIn) + { + var temp = (1 - value) * _screenSize.y; + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x, _cachedAnchorPos.y + temp); + } + if ((panelConfig.animationType & EAnimationMode.ToastSlideIn) == EAnimationMode.ToastSlideIn) + { + var temp = (1 - value) * GetToastSlideInOffset(); + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x, _cachedAnchorPos.y + temp); + } + } + + if ((panelConfig.animationType & EAnimationMode.Alpha) == EAnimationMode.Alpha) + { + canvasGroup.alpha = 0; + } + if ((panelConfig.animationType & EAnimationMode.Scale) == EAnimationMode.Scale) + { + transform.localScale = Vector3.zero; + } + if ((panelConfig.animationType & EAnimationMode.RightSlideIn) == EAnimationMode.RightSlideIn) + { + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x + _screenSize.x, _cachedAnchorPos.y); + } + if ((panelConfig.animationType & EAnimationMode.UpSlideIn) == EAnimationMode.UpSlideIn) + { + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x, _cachedAnchorPos.y + _screenSize.y); + } + if ((panelConfig.animationType & EAnimationMode.ToastSlideIn) == EAnimationMode.ToastSlideIn) + { + _rectTransform.anchoredPosition = new Vector2(_cachedAnchorPos.x, _cachedAnchorPos.y + GetToastSlideInOffset()); + } + + OnCloseEffectEnd(); + } + + #endregion + + + /// + /// on receive resolution change event + /// + /// + protected virtual void UIAdapt(Vector2Int res) {} + + /// + /// common close api + /// + public virtual void Close() + { + UIManager.Instance.RemoveUI(this); + } + + /// + /// set canvas sorting order + /// + /// + public void SetOpenOrder(int openOrder) + { + if (canvas != null) + { + canvas.sortingOrder = openOrder; + } + } + + /// + /// also would destroy panel gameObject + /// + public virtual void Dispose() + { + if (panelConfig.animationType == EAnimationMode.None) + { + GameObject.Destroy(gameObject); + return; + } + + OnCloseEffectStart(); + } + } +} diff --git a/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta b/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta new file mode 100644 index 0000000..9d387c1 --- /dev/null +++ b/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46b452bcf000a41f98212ccee88899e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Params.meta b/Runtime/Internal/UI/Params.meta new file mode 100644 index 0000000..092c2d9 --- /dev/null +++ b/Runtime/Internal/UI/Params.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39f7fade888d64e9193a7bed1148b13d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Params/BasePanelConfig.cs b/Runtime/Internal/UI/Params/BasePanelConfig.cs new file mode 100644 index 0000000..7497444 --- /dev/null +++ b/Runtime/Internal/UI/Params/BasePanelConfig.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace TapTap.UI +{ + [System.Serializable] + public struct BasePanelConfig + { + /// + /// animation effect related to opening and closing + /// + public EAnimationMode animationType; + + public BasePanelConfig(EAnimationMode animationMode = EAnimationMode.None) + { + animationType = animationMode; + } + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta b/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta new file mode 100644 index 0000000..fce1083 --- /dev/null +++ b/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2be27146852e4ff1a93a250036bed2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/Params/IOpenPanelParameter.cs b/Runtime/Internal/UI/Params/IOpenPanelParameter.cs new file mode 100644 index 0000000..b4fe37e --- /dev/null +++ b/Runtime/Internal/UI/Params/IOpenPanelParameter.cs @@ -0,0 +1,7 @@ +namespace TapTap.UI +{ + public abstract class AbstractOpenPanelParameter + { + public virtual bool NeedConstantResolution => false; + } +} \ No newline at end of file diff --git a/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta b/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta new file mode 100644 index 0000000..e1754ef --- /dev/null +++ b/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0e76508aefd8446ba91ba241d655950f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/ScrollViewEx.meta b/Runtime/Internal/UI/ScrollViewEx.meta new file mode 100644 index 0000000..4ceecab --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 96e3a90892d5f4d469f093c70e24c4d0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta b/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta new file mode 100644 index 0000000..25da6f5 --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f0676fa1c0082e2408572d35067b7caa +folderAsset: yes +timeCreated: 1533284978 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs b/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs new file mode 100644 index 0000000..75aff92 --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs @@ -0,0 +1,76 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using System.Collections.Generic; + + public class SimpleObjPool + { + private readonly Stack stack; + private readonly Func ctor; + private readonly Action onRecycle; + private int size; + private int usedCount; + + public SimpleObjPool(int max = 7, Action onRecycle = null, Func ctor = null) + { + this.stack = new Stack(max); + this.size = max; + this.onRecycle = onRecycle; + this.ctor = ctor; + } + + public T Get() + { + T item; + if (this.stack.Count == 0) + { + if (this.ctor != null) + { + item = this.ctor(); + } + else + { + item = Activator.CreateInstance(); + } + } + else + { + item = this.stack.Pop(); + } + + this.usedCount++; + return item; + } + + public void Recycle(T item) + { + if (this.onRecycle != null) + { + this.onRecycle.Invoke(item); + } + + if (this.stack.Count < this.size) + { + this.stack.Push(item); + } + + this.usedCount--; + } + + public void Purge() + { + // TODO + } + + public override string ToString() + { + return $"SimpleObjPool: item=[{typeof(T)}], inUse=[{this.usedCount}], restInPool=[{this.stack.Count}/{this.size}] "; + } + } +} diff --git a/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta b/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta new file mode 100644 index 0000000..49a5e26 --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 779a3e961157c3f468ebe1db83df1e8d +timeCreated: 1533284979 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta b/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta new file mode 100644 index 0000000..ec6d62c --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 94da82d2b551d1e4da1543a8beb76371 +folderAsset: yes +timeCreated: 1533284978 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs new file mode 100644 index 0000000..5434f3a --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs @@ -0,0 +1,828 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + using UnityEngine.Serialization; + using UnityEngine.UI; + + [RequireComponent(typeof(RectTransform))] + [DisallowMultipleComponent] + public class ScrollView : ScrollRect + { + [Tooltip("默认item尺寸")] + public Vector2 defaultItemSize; + + [Tooltip("item的模板")] + public RectTransform itemTemplate; + + // 0001 + protected const int flagScrollDirection = 1; + + [SerializeField] + [FormerlySerializedAs("m_layoutType")] + protected ItemLayoutType layoutType = ItemLayoutType.Vertical; + + // 只保存4个临界index + protected int[] criticalItemIndex = new int[4]; + + // callbacks for items + protected Action updateFunc; + protected Func itemSizeFunc; + protected Func itemCountFunc; + protected Func itemGetFunc; + protected Action itemRecycleFunc; + + private readonly List managedItems = new List(); + + private Rect refRect; + + // resource management + private SimpleObjPool itemPool = null; + + private int dataCount = 0; + + [Tooltip("初始化时池内item数量")] + [SerializeField] + private int poolSize; + + // status + private bool initialized = false; + private int willUpdateData = 0; + + private Vector3[] viewWorldConers = new Vector3[4]; + private Vector3[] rectCorners = new Vector3[2]; + + // for hide and show + public enum ItemLayoutType + { + // 最后一位表示滚动方向 + Vertical = 0b0001, // 0001 + Horizontal = 0b0010, // 0010 + VerticalThenHorizontal = 0b0100, // 0100 + HorizontalThenVertical = 0b0101, // 0101 + } + + public virtual void SetUpdateFunc(Action func) + { + this.updateFunc = func; + } + + public virtual void SetItemSizeFunc(Func func) + { + this.itemSizeFunc = func; + } + + public virtual void SetItemCountFunc(Func func) + { + this.itemCountFunc = func; + } + + public void SetItemGetAndRecycleFunc(Func getFunc, Action recycleFunc) + { + if (getFunc != null && recycleFunc != null) + { + this.itemGetFunc = getFunc; + this.itemRecycleFunc = recycleFunc; + } + else + { + this.itemGetFunc = null; + this.itemRecycleFunc = null; + } + } + + public void ResetAllDelegates() + { + this.SetUpdateFunc(null); + this.SetItemSizeFunc(null); + this.SetItemCountFunc(null); + this.SetItemGetAndRecycleFunc(null, null); + } + + public void UpdateData(bool immediately = true) + { + if (immediately) + { + this.willUpdateData |= 3; // 0011 + this.InternalUpdateData(); + } + else + { + if (this.willUpdateData == 0 && this.IsActive()) + { + this.StartCoroutine(this.DelayUpdateData()); + } + + this.willUpdateData |= 3; + } + } + + public void UpdateDataIncrementally(bool immediately = true) + { + if (immediately) + { + this.willUpdateData |= 1; // 0001 + this.InternalUpdateData(); + } + else + { + if (this.willUpdateData == 0) + { + this.StartCoroutine(this.DelayUpdateData()); + } + + this.willUpdateData |= 1; + } + } + + public void ScrollTo(int index) + { + this.InternalScrollTo(index); + } + + protected override void OnEnable() + { + base.OnEnable(); + if (this.willUpdateData != 0) + { + this.StartCoroutine(this.DelayUpdateData()); + } + } + + protected override void OnDisable() + { + this.initialized = false; + base.OnDisable(); + } + + protected virtual void InternalScrollTo(int index) + { + index = Mathf.Clamp(index, 0, this.dataCount - 1); + this.EnsureItemRect(index); + Rect r = this.managedItems[index].rect; + + var dir = (int)this.layoutType & flagScrollDirection; + if (dir == 1) + { + // vertical + var value = 1 - (-r.yMax / (this.content.sizeDelta.y - this.refRect.height)); + this.SetNormalizedPosition(value, 1); + } + else + { + // horizontal + var value = r.xMin / (this.content.sizeDelta.x - this.refRect.width); + this.SetNormalizedPosition(value, 0); + } + } + + protected override void SetContentAnchoredPosition(Vector2 position) + { + base.SetContentAnchoredPosition(position); + this.UpdateCriticalItems(); + } + + protected override void SetNormalizedPosition(float value, int axis) + { + base.SetNormalizedPosition(value, axis); + this.ResetCriticalItems(); + } + + protected void EnsureItemRect(int index) + { + if (!this.managedItems[index].rectDirty) + { + // 已经是干净的了 + return; + } + + ScrollItemWithRect firstItem = this.managedItems[0]; + if (firstItem.rectDirty) + { + Vector2 firstSize = this.GetItemSize(0); + firstItem.rect = CreateWithLeftTopAndSize(Vector2.zero, firstSize); + firstItem.rectDirty = false; + } + + // 当前item之前的最近的已更新的rect + var nearestClean = 0; + for (var i = index; i >= 0; --i) + { + if (!this.managedItems[i].rectDirty) + { + nearestClean = i; + break; + } + } + + // 需要更新 从 nearestClean 到 index 的尺寸 + Rect nearestCleanRect = this.managedItems[nearestClean].rect; + Vector2 curPos = GetLeftTop(nearestCleanRect); + Vector2 size = nearestCleanRect.size; + this.MovePos(ref curPos, size); + + for (var i = nearestClean + 1; i <= index; i++) + { + size = this.GetItemSize(i); + this.managedItems[i].rect = CreateWithLeftTopAndSize(curPos, size); + this.managedItems[i].rectDirty = false; + this.MovePos(ref curPos, size); + } + + var range = new Vector2(Mathf.Abs(curPos.x), Mathf.Abs(curPos.y)); + switch (this.layoutType) + { + case ItemLayoutType.VerticalThenHorizontal: + range.x += size.x; + range.y = this.refRect.height; + break; + case ItemLayoutType.HorizontalThenVertical: + range.x = this.refRect.width; + if (curPos.x != 0) + { + range.y += size.y; + } + + break; + default: + break; + } + + this.content.sizeDelta = range; + } + + protected override void OnDestroy() + { + if (this.itemPool != null) + { + this.itemPool.Purge(); + } + } + + protected Rect GetItemLocalRect(int index) + { + if (index >= 0 && index < this.dataCount) + { + this.EnsureItemRect(index); + return this.managedItems[index].rect; + } + + return (Rect)default; + } + +#if UNITY_EDITOR + protected override void OnValidate() + { + var dir = (int)this.layoutType & flagScrollDirection; + if (dir == 1) + { + // vertical + if (this.horizontalScrollbar != null) + { + this.horizontalScrollbar.gameObject.SetActive(false); + this.horizontalScrollbar = null; + } + } + else + { + // horizontal + if (this.verticalScrollbar != null) + { + this.verticalScrollbar.gameObject.SetActive(false); + this.verticalScrollbar = null; + } + } + + base.OnValidate(); + } +#endif + + private static Vector2 GetLeftTop(Rect rect) + { + Vector2 ret = rect.position; + ret.y += rect.size.y; + return ret; + } + + private static Rect CreateWithLeftTopAndSize(Vector2 leftTop, Vector2 size) + { + Vector2 leftBottom = leftTop - new Vector2(0, size.y); + return new Rect(leftBottom, size); + } + + private IEnumerator DelayUpdateData() + { + yield return new WaitForEndOfFrame(); + this.InternalUpdateData(); + } + + private void InternalUpdateData() + { + if (!this.IsActive()) + { + this.willUpdateData |= 3; + return; + } + + if (!this.initialized) + { + this.InitScrollView(); + } + + var newDataCount = 0; + var keepOldItems = (this.willUpdateData & 2) == 0; + + if (this.itemCountFunc != null) + { + newDataCount = this.itemCountFunc(); + } + + if (newDataCount != this.managedItems.Count) + { + if (this.managedItems.Count < newDataCount) + { + // 增加 + if (!keepOldItems) + { + foreach (var itemWithRect in this.managedItems) + { + // 重置所有rect + itemWithRect.rectDirty = true; + } + } + + while (this.managedItems.Count < newDataCount) + { + this.managedItems.Add(new ScrollItemWithRect()); + } + } + else + { + // 减少 保留空位 避免GC + for (int i = 0, count = this.managedItems.Count; i < count; ++i) + { + if (i < newDataCount) + { + // 重置所有rect + if (!keepOldItems) + { + this.managedItems[i].rectDirty = true; + } + + if (i == newDataCount - 1) + { + this.managedItems[i].rectDirty = true; + } + } + + // 超出部分 清理回收item + if (i >= newDataCount) + { + this.managedItems[i].rectDirty = true; + if (this.managedItems[i].item != null) + { + this.RecycleOldItem(this.managedItems[i].item); + this.managedItems[i].item = null; + } + } + } + } + } + else + { + if (!keepOldItems) + { + for (int i = 0, count = this.managedItems.Count; i < count; ++i) + { + // 重置所有rect + this.managedItems[i].rectDirty = true; + } + } + } + + this.dataCount = newDataCount; + + this.ResetCriticalItems(); + + this.willUpdateData = 0; + } + + private void ResetCriticalItems() + { + bool hasItem, shouldShow; + int firstIndex = -1, lastIndex = -1; + + for (var i = 0; i < this.dataCount; i++) + { + hasItem = this.managedItems[i].item != null; + shouldShow = this.ShouldItemSeenAtIndex(i); + + if (shouldShow) + { + if (firstIndex == -1) + { + firstIndex = i; + } + + lastIndex = i; + } + + if (hasItem && shouldShow) + { + // 应显示且已显示 + this.SetDataForItemAtIndex(this.managedItems[i].item, i); + continue; + } + + if (hasItem == shouldShow) + { + // 不应显示且未显示 + // if (firstIndex != -1) + // { + // // 已经遍历完所有要显示的了 后边的先跳过 + // break; + // } + continue; + } + + if (hasItem && !shouldShow) + { + // 不该显示 但是有 + this.RecycleOldItem(this.managedItems[i].item); + this.managedItems[i].item = null; + continue; + } + + if (shouldShow && !hasItem) + { + // 需要显示 但是没有 + RectTransform item = this.GetNewItem(i); + this.OnGetItemForDataIndex(item, i); + this.managedItems[i].item = item; + continue; + } + } + + // content.localPosition = Vector2.zero; + this.criticalItemIndex[CriticalItemType.UpToHide] = firstIndex; + this.criticalItemIndex[CriticalItemType.DownToHide] = lastIndex; + this.criticalItemIndex[CriticalItemType.UpToShow] = Mathf.Max(firstIndex - 1, 0); + this.criticalItemIndex[CriticalItemType.DownToShow] = Mathf.Min(lastIndex + 1, this.dataCount - 1); + } + + private RectTransform GetCriticalItem(int type) + { + var index = this.criticalItemIndex[type]; + if (index >= 0 && index < this.dataCount) + { + return this.managedItems[index].item; + } + + return null; + } + + private void UpdateCriticalItems() + { + var dirty = true; + + while (dirty) + { + dirty = false; + + for (int i = CriticalItemType.UpToHide; i <= CriticalItemType.DownToShow; i++) + { + if (i <= CriticalItemType.DownToHide) + { + // 隐藏离开可见区域的item + dirty = dirty || this.CheckAndHideItem(i); + } + else + { + // 显示进入可见区域的item + dirty = dirty || this.CheckAndShowItem(i); + } + } + } + } + + private bool CheckAndHideItem(int criticalItemType) + { + RectTransform item = this.GetCriticalItem(criticalItemType); + var criticalIndex = this.criticalItemIndex[criticalItemType]; + if (item != null && !this.ShouldItemSeenAtIndex(criticalIndex)) + { + this.RecycleOldItem(item); + this.managedItems[criticalIndex].item = null; + + if (criticalItemType == CriticalItemType.UpToHide) + { + // 最上隐藏了一个 + this.criticalItemIndex[criticalItemType + 2] = Mathf.Max(criticalIndex, this.criticalItemIndex[criticalItemType + 2]); + this.criticalItemIndex[criticalItemType]++; + } + else + { + // 最下隐藏了一个 + this.criticalItemIndex[criticalItemType + 2] = Mathf.Min(criticalIndex, this.criticalItemIndex[criticalItemType + 2]); + this.criticalItemIndex[criticalItemType]--; + } + + this.criticalItemIndex[criticalItemType] = Mathf.Clamp(this.criticalItemIndex[criticalItemType], 0, this.dataCount - 1); + + if (this.criticalItemIndex[CriticalItemType.UpToHide] > this.criticalItemIndex[CriticalItemType.DownToHide]) + { + // 偶然的情况 拖拽超出一屏 + this.ResetCriticalItems(); + return false; + } + + return true; + } + + return false; + } + + private bool CheckAndShowItem(int criticalItemType) + { + RectTransform item = this.GetCriticalItem(criticalItemType); + var criticalIndex = this.criticalItemIndex[criticalItemType]; + + if (item == null && this.ShouldItemSeenAtIndex(criticalIndex)) + { + RectTransform newItem = this.GetNewItem(criticalIndex); + this.OnGetItemForDataIndex(newItem, criticalIndex); + this.managedItems[criticalIndex].item = newItem; + + if (criticalItemType == CriticalItemType.UpToShow) + { + // 最上显示了一个 + this.criticalItemIndex[criticalItemType - 2] = Mathf.Min(criticalIndex, this.criticalItemIndex[criticalItemType - 2]); + this.criticalItemIndex[criticalItemType]--; + } + else + { + // 最下显示了一个 + this.criticalItemIndex[criticalItemType - 2] = Mathf.Max(criticalIndex, this.criticalItemIndex[criticalItemType - 2]); + this.criticalItemIndex[criticalItemType]++; + } + + this.criticalItemIndex[criticalItemType] = Mathf.Clamp(this.criticalItemIndex[criticalItemType], 0, this.dataCount - 1); + + if (this.criticalItemIndex[CriticalItemType.UpToShow] >= this.criticalItemIndex[CriticalItemType.DownToShow]) + { + // 偶然的情况 拖拽超出一屏 + this.ResetCriticalItems(); + return false; + } + + return true; + } + + return false; + } + + private bool ShouldItemSeenAtIndex(int index) + { + if (index < 0 || index >= this.dataCount) + { + return false; + } + + this.EnsureItemRect(index); + return new Rect(this.refRect.position - this.content.anchoredPosition, this.refRect.size).Overlaps(this.managedItems[index].rect); + } + + private bool ShouldItemFullySeenAtIndex(int index) + { + if (index < 0 || index >= this.dataCount) + { + return false; + } + + this.EnsureItemRect(index); + return this.IsRectContains(new Rect(this.refRect.position - this.content.anchoredPosition, this.refRect.size), this.managedItems[index].rect); + } + + private bool IsRectContains(Rect outRect, Rect inRect, bool bothDimensions = false) + { + if (bothDimensions) + { + var xContains = (outRect.xMax >= inRect.xMax) && (outRect.xMin <= inRect.xMin); + var yContains = (outRect.yMax >= inRect.yMax) && (outRect.yMin <= inRect.yMin); + return xContains && yContains; + } + else + { + var dir = (int)this.layoutType & flagScrollDirection; + if (dir == 1) + { + // 垂直滚动 只计算y向 + return (outRect.yMax >= inRect.yMax) && (outRect.yMin <= inRect.yMin); + } + else + { + // = 0 + // 水平滚动 只计算x向 + return (outRect.xMax >= inRect.xMax) && (outRect.xMin <= inRect.xMin); + } + } + } + + private void InitPool() + { + var poolNode = new GameObject("POOL"); + poolNode.SetActive(false); + poolNode.transform.SetParent(this.transform, false); + this.itemPool = new SimpleObjPool( + this.poolSize, + (RectTransform item) => + { + item.transform.SetParent(poolNode.transform, false); + }, + () => + { + GameObject itemObj = Instantiate(this.itemTemplate.gameObject); + RectTransform item = itemObj.GetComponent(); + itemObj.transform.SetParent(poolNode.transform, false); + + item.anchorMin = Vector2.up; + item.anchorMax = Vector2.up; + item.pivot = Vector2.zero; + + itemObj.SetActive(true); + return item; + }); + } + + private void OnGetItemForDataIndex(RectTransform item, int index) + { + this.SetDataForItemAtIndex(item, index); + item.transform.SetParent(this.content, false); + } + + private void SetDataForItemAtIndex(RectTransform item, int index) + { + if (this.updateFunc != null) + { + this.updateFunc(index, item); + } + + this.SetPosForItemAtIndex(item, index); + } + + private void SetPosForItemAtIndex(RectTransform item, int index) + { + this.EnsureItemRect(index); + Rect r = this.managedItems[index].rect; + item.localPosition = r.position; + item.sizeDelta = r.size; + } + + private Vector2 GetItemSize(int index) + { + if (index >= 0 && index <= this.dataCount) + { + if (this.itemSizeFunc != null) + { + return this.itemSizeFunc(index); + } + } + + return this.defaultItemSize; + } + + private RectTransform GetNewItem(int index) + { + RectTransform item; + if (this.itemGetFunc != null) + { + item = this.itemGetFunc(index); + } + else + { + item = this.itemPool.Get(); + } + + return item; + } + + private void RecycleOldItem(RectTransform item) + { + if (this.itemRecycleFunc != null) + { + this.itemRecycleFunc(item); + } + else + { + this.itemPool.Recycle(item); + } + } + + private void InitScrollView() + { + this.initialized = true; + + // 根据设置来控制原ScrollRect的滚动方向 + var dir = (int)this.layoutType & flagScrollDirection; + this.vertical = dir == 1; + this.horizontal = dir == 0; + + this.content.pivot = Vector2.up; + this.content.anchorMin = Vector2.up; + this.content.anchorMax = Vector2.up; + this.content.anchoredPosition = Vector2.zero; + + this.InitPool(); + this.UpdateRefRect(); + } + + // refRect是在Content节点下的 viewport的 rect + private void UpdateRefRect() + { + /* + * WorldCorners + * + * 1 ------- 2 + * | | + * | | + * 0 ------- 3 + * + */ + + if (!CanvasUpdateRegistry.IsRebuildingLayout()) + { + Canvas.ForceUpdateCanvases(); + } + + this.viewRect.GetWorldCorners(this.viewWorldConers); + this.rectCorners[0] = this.content.transform.InverseTransformPoint(this.viewWorldConers[0]); + this.rectCorners[1] = this.content.transform.InverseTransformPoint(this.viewWorldConers[2]); + this.refRect = new Rect((Vector2)this.rectCorners[0] - this.content.anchoredPosition, this.rectCorners[1] - this.rectCorners[0]); + } + + private void MovePos(ref Vector2 pos, Vector2 size) + { + // 注意 所有的rect都是左下角为基准 + switch (this.layoutType) + { + case ItemLayoutType.Vertical: + // 垂直方向 向下移动 + pos.y -= size.y; + break; + case ItemLayoutType.Horizontal: + // 水平方向 向右移动 + pos.x += size.x; + break; + case ItemLayoutType.VerticalThenHorizontal: + pos.y -= size.y; + if (pos.y <= -this.refRect.height) + { + pos.y = 0; + pos.x += size.x; + } + + break; + case ItemLayoutType.HorizontalThenVertical: + pos.x += size.x; + if (pos.x >= this.refRect.width) + { + pos.x = 0; + pos.y -= size.y; + } + + break; + default: + break; + } + } + + // const int 代替 enum 减少 (int)和(CriticalItemType)转换 + protected static class CriticalItemType + { + public static byte UpToHide = 0; + public static byte DownToHide = 1; + public static byte UpToShow = 2; + public static byte DownToShow = 3; + } + + private class ScrollItemWithRect + { + // scroll item 身上的 RectTransform组件 + public RectTransform item; + + // scroll item 在scrollview中的位置 + public Rect rect; + + // rect 是否需要更新 + public bool rectDirty = true; + } + } +} diff --git a/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta new file mode 100644 index 0000000..eaad719 --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2d355eec575560046ba27246695b84ad +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs new file mode 100644 index 0000000..df2d59b --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs @@ -0,0 +1,245 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) AillieoTech. All rights reserved. +// +// ----------------------------------------------------------------------- + +namespace TapTap.UI.AillieoTech +{ + using System; + using UnityEngine; + using UnityEngine.EventSystems; + using UnityEngine.Serialization; + + [RequireComponent(typeof(RectTransform))] + [DisallowMultipleComponent] + public class ScrollViewEx : ScrollView + { + [SerializeField] + [FormerlySerializedAs("m_pageSize")] + private int pageSize = 50; + + private int startOffset = 0; + + private Func realItemCountFunc; + + private Vector2 lastPosition; + + private bool reloadFlag = false; + + public override void SetUpdateFunc(Action func) + { + if (func != null) + { + var f = func; + func = (index, rect) => + { + f(index + this.startOffset, rect); + }; + } + + base.SetUpdateFunc(func); + } + + public override void SetItemSizeFunc(Func func) + { + if (func != null) + { + var f = func; + func = (index) => + { + return f(index + this.startOffset); + }; + } + + base.SetItemSizeFunc(func); + } + + public override void SetItemCountFunc(Func func) + { + this.realItemCountFunc = func; + if (func != null) + { + var f = func; + func = () => Mathf.Min(f(), this.pageSize); + } + + base.SetItemCountFunc(func); + } + + public override void OnDrag(PointerEventData eventData) + { + if (this.reloadFlag) + { + this.reloadFlag = false; + this.OnEndDrag(eventData); + this.OnBeginDrag(eventData); + + return; + } + + base.OnDrag(eventData); + } + + protected override void Awake() + { + base.Awake(); + + this.lastPosition = Vector2.up; + this.onValueChanged.AddListener(this.OnValueChanged); + } + + protected override void InternalScrollTo(int index) + { + var count = 0; + if (this.realItemCountFunc != null) + { + count = this.realItemCountFunc(); + } + + index = Mathf.Clamp(index, 0, count - 1); + this.startOffset = Mathf.Clamp(index - (this.pageSize / 2), 0, count - this.itemCountFunc()); + this.UpdateData(true); + base.InternalScrollTo(index - this.startOffset); + } + + private void OnValueChanged(Vector2 position) + { + int toShow; + int critical; + bool downward; + int pin; + + Vector2 delta = position - this.lastPosition; + this.lastPosition = position; + + this.reloadFlag = false; + + if (((int)this.layoutType & flagScrollDirection) == 1) + { + // 垂直滚动 只计算y向 + if (delta.y < 0) + { + // 向上 + toShow = this.criticalItemIndex[CriticalItemType.DownToShow]; + critical = this.pageSize - 1; + if (toShow < critical) + { + return; + } + + pin = critical - 1; + downward = false; + } + else if (delta.y > 0) + { + // 向下 + toShow = this.criticalItemIndex[CriticalItemType.UpToShow]; + critical = 0; + if (toShow > critical) + { + return; + } + + pin = critical + 1; + downward = true; + } + else + { + return; + } + } + else + { + // = 0 + // 水平滚动 只计算x向 + if (delta.x > 0) + { + // 向右 + toShow = this.criticalItemIndex[CriticalItemType.UpToShow]; + critical = 0; + if (toShow > critical) + { + return; + } + + pin = critical + 1; + downward = true; + } + else if (delta.x < 0) + { + // 向左 + toShow = this.criticalItemIndex[CriticalItemType.DownToShow]; + critical = this.pageSize - 1; + if (toShow < critical) + { + return; + } + + pin = critical - 1; + downward = false; + } + else + { + return; + } + } + + // 该翻页了 翻半页吧 + var old = this.startOffset; + if (downward) + { + this.startOffset -= this.pageSize / 2; + } + else + { + this.startOffset += this.pageSize / 2; + } + + var realDataCount = 0; + if (this.realItemCountFunc != null) + { + realDataCount = this.realItemCountFunc(); + } + + this.startOffset = Mathf.Clamp(this.startOffset, 0, Mathf.Max(realDataCount - this.pageSize, 0)); + + if (old != this.startOffset) + { + this.reloadFlag = true; + + // 记录 原先的速度 + Vector2 oldVelocity = this.velocity; + + // 计算 pin元素的世界坐标 + Rect rect = this.GetItemLocalRect(pin); + + Vector2 oldWorld = this.content.TransformPoint(rect.position); + var dataCount = 0; + if (this.itemCountFunc != null) + { + dataCount = this.itemCountFunc(); + } + + if (dataCount > 0) + { + this.EnsureItemRect(0); + if (dataCount > 1) + { + this.EnsureItemRect(dataCount - 1); + } + } + + // 根据 pin元素的世界坐标 计算出content的position + var pin2 = pin + old - this.startOffset; + Rect rect2 = this.GetItemLocalRect(pin2); + Vector2 newWorld = this.content.TransformPoint(rect2.position); + Vector2 deltaWorld = newWorld - oldWorld; + Vector2 deltaLocal = this.content.InverseTransformVector(deltaWorld); + this.SetContentAnchoredPosition(this.content.anchoredPosition - deltaLocal); + this.UpdateData(true); + this.velocity = oldVelocity; + } + } + } +} diff --git a/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta new file mode 100644 index 0000000..036ab2a --- /dev/null +++ b/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d8f3e076f25860743a2d5212b2c285ac +timeCreated: 1533042733 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Utils.meta b/Runtime/Internal/Utils.meta new file mode 100644 index 0000000..738b82c --- /dev/null +++ b/Runtime/Internal/Utils.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4f9eaaa5cea3455a8001c99a0a292e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Utils/BridgeUtils.cs b/Runtime/Internal/Utils/BridgeUtils.cs new file mode 100644 index 0000000..7945be6 --- /dev/null +++ b/Runtime/Internal/Utils/BridgeUtils.cs @@ -0,0 +1,27 @@ +using System; +using System.Linq; +using UnityEngine; + +namespace TapTap.Common.Internal.Utils { + public static class BridgeUtils { + public static bool IsSupportMobilePlatform => Application.platform == RuntimePlatform.Android || + Application.platform == RuntimePlatform.IPhonePlayer; + + public static bool IsSupportStandalonePlatform => Application.platform == RuntimePlatform.OSXPlayer || + Application.platform == RuntimePlatform.WindowsPlayer || + Application.platform == RuntimePlatform.LinuxPlayer; + + public static object CreateBridgeImplementation(Type interfaceType, string startWith) { + Type bridgeImplementationType = AppDomain.CurrentDomain.GetAssemblies() + .Where(asssembly => asssembly.GetName().FullName.StartsWith(startWith)) + .SelectMany(assembly => assembly.GetTypes()) + .SingleOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass); + if (bridgeImplementationType == null){ + Debug.LogWarningFormat( + $"[TapTap] TapSDK Can't find bridge implementation for {interfaceType} on platform {Application.platform}."); + return null; + } + return Activator.CreateInstance(bridgeImplementationType); + } + } +} diff --git a/Runtime/Internal/Utils/BridgeUtils.cs.meta b/Runtime/Internal/Utils/BridgeUtils.cs.meta new file mode 100644 index 0000000..7f94b61 --- /dev/null +++ b/Runtime/Internal/Utils/BridgeUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a95ca8c05f56b4d619ee5774a344c11e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Utils/ImageUtils.cs b/Runtime/Internal/Utils/ImageUtils.cs new file mode 100644 index 0000000..fe03829 --- /dev/null +++ b/Runtime/Internal/Utils/ImageUtils.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.Networking; + +namespace TapTap.Common.Internal.Utils { + public class ImageUtils { + private static Dictionary> cachedTextures = new Dictionary>(); + + public static async Task LoadImage(string url) { + if (string.IsNullOrEmpty(url)) { + TapLogger.Warn(string.Format($"ImageUtils Fetch image is null! url is null or empty!")); + return null; + } + if (cachedTextures.TryGetValue(url, out WeakReference refTex) && + refTex.TryGetTarget(out Texture tex)) { + return tex; + } else { + Texture newTex = await FetchImage(url); + cachedTextures[url] = new WeakReference(newTex); + return newTex; + } + } + + public static async Task FetchImage(string url) { + UnityWebRequest www = UnityWebRequestTexture.GetTexture(url); + UnityWebRequestAsyncOperation operation = www.SendWebRequest(); + while (!operation.isDone) { + await Task.Delay(50); + } + + if (www.isNetworkError || www.isHttpError) { + throw new Exception("Fetch image error."); + } else { + var texture = ((DownloadHandlerTexture)www.downloadHandler)?.texture; + if (texture == null){ + TapLogger.Warn(string.Format($"ImageUtils Fetch image is null! url: {url}")); + } + return texture; + } + } + } +} diff --git a/Runtime/Internal/Utils/ImageUtils.cs.meta b/Runtime/Internal/Utils/ImageUtils.cs.meta new file mode 100644 index 0000000..f6193e0 --- /dev/null +++ b/Runtime/Internal/Utils/ImageUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2d7ef0d3fce14b07ba2f08a125cd90d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Internal/Utils/UnityMonobehaviorWrapper.cs b/Runtime/Internal/Utils/UnityMonobehaviorWrapper.cs new file mode 100644 index 0000000..451b1cf --- /dev/null +++ b/Runtime/Internal/Utils/UnityMonobehaviorWrapper.cs @@ -0,0 +1,21 @@ +using TapTap.UI; + +namespace TapTap.Common { + internal sealed class UnityMonobehaviorWrapper : MonoSingleton { + + private bool isPause = false; + + private void OnApplicationPause(bool pauseStatus) { + if (pauseStatus && isPause == false) { + isPause = true; + EventManager.TriggerEvent(EventConst.OnApplicationPause, true); + } + else if (!pauseStatus && isPause) { + isPause = false; + EventManager.TriggerEvent(EventConst.OnApplicationPause, false); + } + } + + } +} + diff --git a/Runtime/Internal/Utils/UnityMonobehaviorWrapper.cs.meta b/Runtime/Internal/Utils/UnityMonobehaviorWrapper.cs.meta new file mode 100644 index 0000000..d878409 --- /dev/null +++ b/Runtime/Internal/Utils/UnityMonobehaviorWrapper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1209ab5964164edc808afba228a398a2 +timeCreated: 1689841086 \ No newline at end of file diff --git a/Runtime/Internal/Utils/UrlUtils.cs b/Runtime/Internal/Utils/UrlUtils.cs new file mode 100644 index 0000000..31b3c04 --- /dev/null +++ b/Runtime/Internal/Utils/UrlUtils.cs @@ -0,0 +1,34 @@ +using System.Net; +using System.Linq; +using System.Collections.Specialized; + +namespace TapTap.Common.Internal.Utils { + public class UrlUtils { + public static NameValueCollection ParseQueryString(string query) { + NameValueCollection nvc = new NameValueCollection(); + + if (query.StartsWith("?")) { + query = query.Substring(1); + } + + foreach (var param in query.Split('&')) { + string[] pair = param.Split('='); + if (pair.Length == 2) { + string key = WebUtility.UrlDecode(pair[0]); + string value = WebUtility.UrlDecode(pair[1]); + nvc[key] = value; + } + } + + return nvc; + } + + public static string ToQueryString(NameValueCollection nvc) { + var array = (from key in nvc.AllKeys + from value in nvc.GetValues(key) + select $"{WebUtility.UrlEncode(key)}={WebUtility.UrlEncode(value)}" + ).ToArray(); + return string.Join("&", array); + } + } +} \ No newline at end of file diff --git a/Runtime/Internal/Utils/UrlUtils.cs.meta b/Runtime/Internal/Utils/UrlUtils.cs.meta new file mode 100644 index 0000000..1911a8e --- /dev/null +++ b/Runtime/Internal/Utils/UrlUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18cd0bfb94c9048a783c8b1c79854dc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public.meta b/Runtime/Public.meta new file mode 100644 index 0000000..1c17b4d --- /dev/null +++ b/Runtime/Public.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0117da2dd0ac463698d391472aa909d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/DataStorage.cs b/Runtime/Public/DataStorage.cs new file mode 100644 index 0000000..c506508 --- /dev/null +++ b/Runtime/Public/DataStorage.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.NetworkInformation; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +namespace TapTap.Common +{ + public static class DataStorage + { + private static Dictionary dataCache; + private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; + public static void SaveString(string key, string value) + { + SaveStringToCache(key, value); + PlayerPrefs.SetString(key, EncodeString(value)); + } + + public static string LoadString(string key) + { + string value = LoadStringFromCache(key); + if (!string.IsNullOrEmpty(value)) + { + return value; + } + value = PlayerPrefs.HasKey(key) ? DecodeString(PlayerPrefs.GetString(key)) : null; + if (value != null) + { + SaveStringToCache(key, value); + } + return value; + } + + private static void SaveStringToCache(string key, string value) + { + if (dataCache == null) + { + dataCache = new Dictionary(); + } + if (dataCache.ContainsKey(key)) + { + dataCache[key] = value; + } + else + { + dataCache.Add(key, value); + } + } + + private static string LoadStringFromCache(string key) + { + if (dataCache == null) + { + dataCache = new Dictionary(); + } + return dataCache.ContainsKey(key) ? dataCache[key] : null; + } + + private static string EncodeString(string encryptString) + { + if (Platform.IsAndroid() || Platform.IsIOS()) + { + return encryptString; + } + try + { + byte[] rgbKey = Encoding.UTF8.GetBytes(GetMacAddress().Substring(0, 8)); + byte[] rgbIV = Keys; + byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString); + DESCryptoServiceProvider dCSP = new DESCryptoServiceProvider(); + MemoryStream mStream = new MemoryStream(); + CryptoStream cStream = new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write); + cStream.Write(inputByteArray, 0, inputByteArray.Length); + cStream.FlushFinalBlock(); + cStream.Close(); + return Convert.ToBase64String(mStream.ToArray()); + } + catch + { + return encryptString; + } + } + + private static string DecodeString(string decryptString) + { + if (Platform.IsAndroid() || Platform.IsIOS()) + { + return decryptString; + } + try + { + byte[] rgbKey = Encoding.UTF8.GetBytes(GetMacAddress().Substring(0, 8)); + byte[] rgbIV = Keys; + byte[] inputByteArray = Convert.FromBase64String(decryptString); + DESCryptoServiceProvider DCSP = new DESCryptoServiceProvider(); + MemoryStream mStream = new MemoryStream(); + CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write); + cStream.Write(inputByteArray, 0, inputByteArray.Length); + cStream.FlushFinalBlock(); + cStream.Close(); + return Encoding.UTF8.GetString(mStream.ToArray()); + } + catch (Exception e) + { + Debug.Log(e.Message); + return decryptString; + } + } + + private static string GetMacAddress() + { + string physicalAddress = "FFFFFFFFFFFF"; + if (Platform.IsAndroid() || Platform.IsIOS()) + { + return physicalAddress; + } + NetworkInterface[] nice = NetworkInterface.GetAllNetworkInterfaces(); + + foreach (NetworkInterface adaper in nice) + { + if (adaper.Description == "en0") + { + physicalAddress = adaper.GetPhysicalAddress().ToString(); + break; + } + else + { + physicalAddress = adaper.GetPhysicalAddress().ToString(); + + if (physicalAddress != "") + { + break; + }; + } + } + return physicalAddress; + } + } +} \ No newline at end of file diff --git a/Runtime/Public/DataStorage.cs.meta b/Runtime/Public/DataStorage.cs.meta new file mode 100644 index 0000000..089ac78 --- /dev/null +++ b/Runtime/Public/DataStorage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a93138f1b4a3f477cbb3628aef75f88e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/Event.meta b/Runtime/Public/Event.meta new file mode 100644 index 0000000..461b105 --- /dev/null +++ b/Runtime/Public/Event.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2af69bd8d7924642a3d6d1938aa5057b +timeCreated: 1689826385 \ No newline at end of file diff --git a/Runtime/Public/Event/EventConst.cs b/Runtime/Public/Event/EventConst.cs new file mode 100644 index 0000000..f762f5b --- /dev/null +++ b/Runtime/Public/Event/EventConst.cs @@ -0,0 +1,10 @@ +namespace TapTap.Common { + public sealed class EventConst { + public const string OnApplicationPause = "OnApplicationPause"; + public const string OnTapLogin = "OnTapLogin"; + public const string OnTapLogout = "OnTapLogout"; + public const string OnBind = "OnBind"; + public const string OnUnbind = "OnBind"; + public const string SetRND = "SetRND"; + } +} \ No newline at end of file diff --git a/Runtime/Public/Event/EventConst.cs.meta b/Runtime/Public/Event/EventConst.cs.meta new file mode 100644 index 0000000..1c421f7 --- /dev/null +++ b/Runtime/Public/Event/EventConst.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5f5d6662366c491ea3fc278335fad422 +timeCreated: 1689826378 \ No newline at end of file diff --git a/Runtime/Public/Event/EventManager.cs b/Runtime/Public/Event/EventManager.cs new file mode 100644 index 0000000..e34645b --- /dev/null +++ b/Runtime/Public/Event/EventManager.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using TapTap.UI; + +namespace TapTap.Common +{ + public sealed class EventManager : Singleton + { + private Dictionary> eventRegistries = new Dictionary>(); + + public static void AddListener(string eventName, Action listener) { + if (listener == null) return; + if (string.IsNullOrEmpty(eventName)) return; + Action thisEvent; + if (Instance.eventRegistries.TryGetValue(eventName, out thisEvent)) { + thisEvent += listener; + Instance.eventRegistries[eventName] = thisEvent; + } else { + thisEvent += listener; + Instance.eventRegistries.Add(eventName, thisEvent); + } + } + + public static void RemoveListener(string eventName, Action listener) { + if (listener == null) return; + if (string.IsNullOrEmpty(eventName)) return; + Action thisEvent; + if (Instance.eventRegistries.TryGetValue(eventName, out thisEvent)) { + thisEvent -= listener; + Instance.eventRegistries[eventName] = thisEvent; + } + } + + public static void TriggerEvent(string eventName, object message) { + Action thisEvent = null; + if (Instance.eventRegistries.TryGetValue(eventName, out thisEvent)) { + thisEvent.Invoke(message); + } + } + } +} \ No newline at end of file diff --git a/Runtime/Public/Event/EventManager.cs.meta b/Runtime/Public/Event/EventManager.cs.meta new file mode 100644 index 0000000..b158152 --- /dev/null +++ b/Runtime/Public/Event/EventManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 449ba9aeaa6d4e20b778d01d41b92284 +timeCreated: 1689665031 \ No newline at end of file diff --git a/Runtime/Public/ITapPropertiesProxy.cs b/Runtime/Public/ITapPropertiesProxy.cs new file mode 100644 index 0000000..eda1100 --- /dev/null +++ b/Runtime/Public/ITapPropertiesProxy.cs @@ -0,0 +1,6 @@ + +namespace TapTap.Common { + public interface ITapPropertiesProxy { + string GetProperties(); + } +} diff --git a/Runtime/Public/ITapPropertiesProxy.cs.meta b/Runtime/Public/ITapPropertiesProxy.cs.meta new file mode 100644 index 0000000..4dd12df --- /dev/null +++ b/Runtime/Public/ITapPropertiesProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7382c48a89c82405e8121c5cf262cad8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/Json.cs b/Runtime/Public/Json.cs new file mode 100644 index 0000000..7bb1ba2 --- /dev/null +++ b/Runtime/Public/Json.cs @@ -0,0 +1,636 @@ +/* + * Copyright (c) 2013 Calvin Rien + * + * Based on the JSON parser by Patrick van Bergen + * http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html + * + * Simplified it so that it doesn't throw exceptions + * and can be used in Unity iPhone with maximum code stripping. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Globalization; + +//Serializer,Serialize + +namespace TapTap.Common +{ + // Example usage: + // + // using UnityEngine; + // using System.Collections; + // using System.Collections.Generic; + // using MiniJSON; + // + // public class MiniJSONTest : MonoBehaviour { + // void Start () { + // var jsonString = "{ \"array\": [1.44,2,3], " + + // "\"object\": {\"key1\":\"value1\", \"key2\":256}, " + + // "\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " + + // "\"unicode\": \"\\u3041 Men\u00fa sesi\u00f3n\", " + + // "\"int\": 65536, " + + // "\"float\": 3.1415926, " + + // "\"bool\": true, " + + // "\"null\": null }"; + // + // var dict = Json.Deserialize(jsonString) as Dictionary; + // + // Debug.Log("deserialized: " + dict.GetType()); + // Debug.Log("dict['array'][0]: " + ((List) dict["array"])[0]); + // Debug.Log("dict['string']: " + (string) dict["string"]); + // Debug.Log("dict['float']: " + (double) dict["float"]); // floats come out as doubles + // Debug.Log("dict['int']: " + (long) dict["int"]); // ints come out as longs + // Debug.Log("dict['unicode']: " + (string) dict["unicode"]); + // + // var str = Json.Serialize(dict); + // + // Debug.Log("serialized: " + str); + // } + // } + + /// + /// This class encodes and decodes JSON strings. + /// Spec. details, see http://www.json.org/ + /// + /// JSON uses Arrays and Objects. These correspond here to the datatypes IList and IDictionary. + /// All numbers are parsed to doubles. + /// + public static class Json + { + + /// + /// Parses the string json into a value + /// + /// A JSON string. + /// An List<object>, a Dictionary<string, object>, a double, an integer,a string, null, true, or false + public static object Deserialize(string json) + { + // save the string for debug information + if (json == null) + { + return null; + } + + return Parser.Parse(json); + } + + sealed class Parser : IDisposable + { + const string WORD_BREAK = "{}[],:\""; + + public static bool IsWordBreak(char c) + { + return Char.IsWhiteSpace(c) || WORD_BREAK.IndexOf(c) != -1; + } + + enum TOKEN + { + NONE, + CURLY_OPEN, + CURLY_CLOSE, + SQUARED_OPEN, + SQUARED_CLOSE, + COLON, + COMMA, + STRING, + NUMBER, + TRUE, + FALSE, + NULL + }; + + StringReader json; + + Parser(string jsonString) + { + json = new StringReader(jsonString); + } + + public static object Parse(string jsonString) + { + using (var instance = new Parser(jsonString)) + { + return instance.ParseValue(); + } + } + + public void Dispose() + { + json.Dispose(); + json = null; + } + + Dictionary ParseObject() + { + Dictionary table = new Dictionary(); + + // ditch opening brace + json.Read(); + + // { + while (true) + { + switch (NextToken) + { + case TOKEN.NONE: + return null; + case TOKEN.COMMA: + continue; + case TOKEN.CURLY_CLOSE: + return table; + default: + // name + string name = ParseString(); + if (name == null) + { + return null; + } + + // : + if (NextToken != TOKEN.COLON) + { + return null; + } + // ditch the colon + json.Read(); + + // value + table[name] = ParseValue(); + break; + } + } + } + + List ParseArray() + { + List array = new List(); + + // ditch opening bracket + json.Read(); + + // [ + var parsing = true; + while (parsing) + { + TOKEN nextToken = NextToken; + + switch (nextToken) + { + case TOKEN.NONE: + return null; + case TOKEN.COMMA: + continue; + case TOKEN.SQUARED_CLOSE: + parsing = false; + break; + default: + object value = ParseByToken(nextToken); + + array.Add(value); + break; + } + } + + return array; + } + + object ParseValue() + { + TOKEN nextToken = NextToken; + return ParseByToken(nextToken); + } + + object ParseByToken(TOKEN token) + { + switch (token) + { + case TOKEN.STRING: + return ParseString(); + case TOKEN.NUMBER: + return ParseNumber(); + case TOKEN.CURLY_OPEN: + return ParseObject(); + case TOKEN.SQUARED_OPEN: + return ParseArray(); + case TOKEN.TRUE: + return true; + case TOKEN.FALSE: + return false; + case TOKEN.NULL: + return null; + default: + return null; + } + } + + string ParseString() + { + StringBuilder s = new StringBuilder(); + char c; + + // ditch opening quote + json.Read(); + + bool parsing = true; + while (parsing) + { + + if (json.Peek() == -1) + { + parsing = false; + break; + } + + c = NextChar; + switch (c) + { + case '"': + parsing = false; + break; + case '\\': + if (json.Peek() == -1) + { + parsing = false; + break; + } + + c = NextChar; + switch (c) + { + case '"': + case '\\': + case '/': + s.Append(c); + break; + case 'b': + s.Append('\b'); + break; + case 'f': + s.Append('\f'); + break; + case 'n': + s.Append('\n'); + break; + case 'r': + s.Append('\r'); + break; + case 't': + s.Append('\t'); + break; + case 'u': + var hex = new char[4]; + + for (int i = 0; i < 4; i++) + { + hex[i] = NextChar; + } + + s.Append((char)Convert.ToInt32(new string(hex), 16)); + break; + } + break; + default: + s.Append(c); + break; + } + } + + return s.ToString(); + } + + object ParseNumber() + { + string number = NextWord; + + if (number.IndexOf('.') == -1) + { + long parsedInt; + Int64.TryParse(number, NumberStyles.Number, CultureInfo.InvariantCulture, out parsedInt); + return parsedInt; + } + + double parsedDouble; + Double.TryParse(number, NumberStyles.Number, CultureInfo.InvariantCulture, out parsedDouble); + return parsedDouble; + } + + void EatWhitespace() + { + while (Char.IsWhiteSpace(PeekChar)) + { + json.Read(); + + if (json.Peek() == -1) + { + break; + } + } + } + + char PeekChar + { + get + { + return Convert.ToChar(json.Peek()); + } + } + + char NextChar + { + get + { + return Convert.ToChar(json.Read()); + } + } + + string NextWord + { + get + { + StringBuilder word = new StringBuilder(); + + while (!IsWordBreak(PeekChar)) + { + word.Append(NextChar); + + if (json.Peek() == -1) + { + break; + } + } + + return word.ToString(); + } + } + + TOKEN NextToken + { + get + { + EatWhitespace(); + + if (json.Peek() == -1) + { + return TOKEN.NONE; + } + + switch (PeekChar) + { + case '{': + return TOKEN.CURLY_OPEN; + case '}': + json.Read(); + return TOKEN.CURLY_CLOSE; + case '[': + return TOKEN.SQUARED_OPEN; + case ']': + json.Read(); + return TOKEN.SQUARED_CLOSE; + case ',': + json.Read(); + return TOKEN.COMMA; + case '"': + return TOKEN.STRING; + case ':': + return TOKEN.COLON; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + return TOKEN.NUMBER; + } + + switch (NextWord) + { + case "false": + return TOKEN.FALSE; + case "true": + return TOKEN.TRUE; + case "null": + return TOKEN.NULL; + } + + return TOKEN.NONE; + } + } + } + + /// + /// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string + /// + /// A Dictionary<string, object> / List<object> + /// A JSON encoded string, or null if object 'json' is not serializable + public static string Serialize(object obj) + { + return Serializer.Serialize(obj); + } + + sealed class Serializer + { + StringBuilder builder; + + Serializer() + { + builder = new StringBuilder(); + } + + public static string Serialize(object obj) + { + var instance = new Serializer(); + + instance.SerializeValue(obj); + + return instance.builder.ToString(); + } + + void SerializeValue(object value) + { + IList asList; + IDictionary asDict; + string asStr; + + if (value == null) + { + builder.Append("null"); + } + else if ((asStr = value as string) != null) + { + SerializeString(asStr); + } + else if (value is bool) + { + builder.Append((bool)value ? "true" : "false"); + } + else if ((asList = value as IList) != null) + { + SerializeArray(asList); + } + else if ((asDict = value as IDictionary) != null) + { + SerializeObject(asDict); + } + else if (value is char) + { + SerializeString(new string((char)value, 1)); + } + else + { + SerializeOther(value); + } + } + + void SerializeObject(IDictionary obj) + { + bool first = true; + + builder.Append('{'); + + foreach (object e in obj.Keys) + { + if (!first) + { + builder.Append(','); + } + + SerializeString(e.ToString()); + builder.Append(':'); + + SerializeValue(obj[e]); + + first = false; + } + + builder.Append('}'); + } + + void SerializeArray(IList anArray) + { + builder.Append('['); + + bool first = true; + + foreach (object obj in anArray) + { + if (!first) + { + builder.Append(','); + } + + SerializeValue(obj); + + first = false; + } + + builder.Append(']'); + } + + void SerializeString(string str) + { + builder.Append('\"'); + + char[] charArray = str.ToCharArray(); + foreach (var c in charArray) + { + switch (c) + { + case '"': + builder.Append("\\\""); + break; + case '\\': + builder.Append("\\\\"); + break; + case '\b': + builder.Append("\\b"); + break; + case '\f': + builder.Append("\\f"); + break; + case '\n': + builder.Append("\\n"); + break; + case '\r': + builder.Append("\\r"); + break; + case '\t': + builder.Append("\\t"); + break; + default: + int codepoint = Convert.ToInt32(c); + if ((codepoint >= 32) && (codepoint <= 126)) + { + builder.Append(c); + } + else + { + builder.Append("\\u"); + builder.Append(codepoint.ToString("x4")); + } + break; + } + } + + builder.Append('\"'); + } + + void SerializeOther(object value) + { + // NOTE: decimals lose precision during serialization. + // They always have, I'm just letting you know. + // Previously floats and doubles lost precision too. + if (value is float) + { + builder.Append(((float)value).ToString("R", CultureInfo.InvariantCulture)); + } + else if (value is int + || value is uint + || value is long + || value is sbyte + || value is byte + || value is short + || value is ushort + || value is ulong) + { + builder.Append(value); + } + else if (value is double + || value is decimal) + { + builder.Append(Convert.ToDouble(value).ToString("R", CultureInfo.InvariantCulture)); + } + else + { + SerializeString(value.ToString()); + } + } + } + } +} \ No newline at end of file diff --git a/Runtime/Public/Json.cs.meta b/Runtime/Public/Json.cs.meta new file mode 100644 index 0000000..cf0dd76 --- /dev/null +++ b/Runtime/Public/Json.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e996a98c26d7e4672b1b35390feb6fb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/Log.meta b/Runtime/Public/Log.meta new file mode 100644 index 0000000..d1d17fc --- /dev/null +++ b/Runtime/Public/Log.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e28d66eab964d4467b1dccbd59acd417 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/Log/TapLogLevel.cs b/Runtime/Public/Log/TapLogLevel.cs new file mode 100644 index 0000000..1530590 --- /dev/null +++ b/Runtime/Public/Log/TapLogLevel.cs @@ -0,0 +1,7 @@ +namespace TapTap.Common { + public enum TapLogLevel { + Debug, + Warn, + Error, + } +} diff --git a/Runtime/Public/Log/TapLogLevel.cs.meta b/Runtime/Public/Log/TapLogLevel.cs.meta new file mode 100644 index 0000000..5abac50 --- /dev/null +++ b/Runtime/Public/Log/TapLogLevel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 813c28743c7e848f1a40e17cdd0f6cf6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/Log/TapLogger.cs b/Runtime/Public/Log/TapLogger.cs new file mode 100644 index 0000000..f2b552a --- /dev/null +++ b/Runtime/Public/Log/TapLogger.cs @@ -0,0 +1,48 @@ +using System; +using System.Text; + +namespace TapTap.Common { + public class TapLogger { + /// + /// Configures the logger. + /// + /// The log delegate. + public static Action LogDelegate { + get; set; + } + + public static void Debug(string log) { + LogDelegate?.Invoke(TapLogLevel.Debug, log); + } + + public static void Debug(string format, params object[] args) { + LogDelegate?.Invoke(TapLogLevel.Debug, string.Format(format, args)); + } + + public static void Warn(string log) { + LogDelegate?.Invoke(TapLogLevel.Warn, log); + } + + public static void Warn(string format, params object[] args) { + LogDelegate?.Invoke(TapLogLevel.Warn, string.Format(format, args)); + } + + public static void Error(string log) { + LogDelegate?.Invoke(TapLogLevel.Error, log); + } + + public static void Error(string format, params object[] args) { + LogDelegate?.Invoke(TapLogLevel.Error, string.Format(format, args)); + } + + public static void Error(Exception e) { + StringBuilder sb = new StringBuilder(); + sb.Append(e.GetType()); + sb.Append("\n"); + sb.Append(e.Message); + sb.Append("\n"); + sb.Append(e.StackTrace); + Error(sb.ToString()); + } + } +} diff --git a/Runtime/Public/Log/TapLogger.cs.meta b/Runtime/Public/Log/TapLogger.cs.meta new file mode 100644 index 0000000..a0bdf38 --- /dev/null +++ b/Runtime/Public/Log/TapLogger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4487382c226534660b2e98bb1fd96367 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/Platform.cs b/Runtime/Public/Platform.cs new file mode 100644 index 0000000..af9dc89 --- /dev/null +++ b/Runtime/Public/Platform.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace TapTap.Common +{ + public class Platform + { + public static bool IsAndroid() + { + return Application.platform == RuntimePlatform.Android; + } + + public static bool IsIOS() + { + return Application.platform == RuntimePlatform.IPhonePlayer; + } + + public static bool IsWin32() + { + return Application.platform == RuntimePlatform.WindowsPlayer; + } + + public static bool IsMacOS() + { + return Application.platform == RuntimePlatform.OSXPlayer; + } + } +} \ No newline at end of file diff --git a/Runtime/Public/Platform.cs.meta b/Runtime/Public/Platform.cs.meta new file mode 100644 index 0000000..36fb108 --- /dev/null +++ b/Runtime/Public/Platform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8167e3c79a6144b5abc4a8bf0857b57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/RegionType.cs b/Runtime/Public/RegionType.cs new file mode 100644 index 0000000..d437dee --- /dev/null +++ b/Runtime/Public/RegionType.cs @@ -0,0 +1,8 @@ +namespace TapTap.Common +{ + public enum RegionType : int + { + CN = 0, + IO = 1 + } +} \ No newline at end of file diff --git a/Runtime/Public/RegionType.cs.meta b/Runtime/Public/RegionType.cs.meta new file mode 100644 index 0000000..0f799f7 --- /dev/null +++ b/Runtime/Public/RegionType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 268a4f9909e694565ae3566e6cc1cdbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/SafeDictionary.cs b/Runtime/Public/SafeDictionary.cs new file mode 100644 index 0000000..0139ca8 --- /dev/null +++ b/Runtime/Public/SafeDictionary.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace TapTap.Common +{ + public static class SafeDictionary + { + public static T GetValue (Dictionary dic, string key, T defaultVal = default(T)) + { + if (dic == null || dic.Keys.Count == 0) return default(T); + if (!dic.TryGetValue(key, out var outputValue)) + return defaultVal; + if(typeof(T) == typeof(int)){ + return (T)(object)int.Parse(outputValue.ToString()); + } + if(typeof(T) == typeof(double)){ + return (T)(object)double.Parse(outputValue.ToString()); + } + if(typeof(T) == typeof(long)){ + return (T)(object)long.Parse(outputValue.ToString()); + } + if(typeof(T) == typeof(bool)){ + return (T)outputValue; + } + return (T) outputValue; + } + } +} \ No newline at end of file diff --git a/Runtime/Public/SafeDictionary.cs.meta b/Runtime/Public/SafeDictionary.cs.meta new file mode 100644 index 0000000..7afe37e --- /dev/null +++ b/Runtime/Public/SafeDictionary.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d7f9c1cdee3d45f2b24e5fed7162dde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapCommon.cs b/Runtime/Public/TapCommon.cs new file mode 100644 index 0000000..2e92bb8 --- /dev/null +++ b/Runtime/Public/TapCommon.cs @@ -0,0 +1,120 @@ +using System; +using System.Threading.Tasks; +using com.taptap.tapsdk.bindings.csharp; +using TapTap.Common.Internal; +using TapTap.UI; +using UnityEngine; + +namespace TapTap.Common { + public class TapCommon { + public static readonly string SDKVersion = "3.18.3"; + public static readonly int SDKVersionCode = 31700001; + + private static TapConfig config; + + public static TapConfig Config => config; + + private static ITapCommonPlatform platformWrapper; + + private static bool disableDurationStatistics; + + public static bool DisableDurationStatistics { + get => disableDurationStatistics; + set { + disableDurationStatistics = value; + } + } + + static TapCommon() { + platformWrapper = PlatformTypeUtils.CreatePlatformImplementationObject(typeof(ITapCommonPlatform), + "TapTap.Common") as ITapCommonPlatform; + } + + public static void Init(TapConfig config) { + TapCommon.config = config; + platformWrapper?.Init(config); + TapDuration.Init(config); + } + + public static void GetRegionCode(Action callback) { + platformWrapper?.GetRegionCode(callback); + } + + public static void IsTapTapInstalled(Action callback) { + platformWrapper?.IsTapTapGlobalInstalled(callback); + } + + public static void IsTapTapGlobalInstalled(Action callback) { + platformWrapper?.IsTapTapGlobalInstalled(callback); + } + + public static void UpdateGameInTapTap(string appId, Action callback) { + platformWrapper?.UpdateGameInTapTap(appId, callback); + } + + public static void UpdateGameInTapGlobal(string appId, Action callback) { + platformWrapper?.UpdateGameInTapGlobal(appId, callback); + } + + public static void OpenReviewInTapTap(string appId, Action callback) { + platformWrapper?.OpenReviewInTapTap(appId, callback); + } + + public static void OpenReviewInTapGlobal(string appId, Action callback) { + platformWrapper?.OpenReviewInTapGlobal(appId, callback); + } + + public static void SetXua() { + platformWrapper?.SetXua(); + } + + public static void SetLanguage(TapLanguage language) { + TapLocalizeManager.SetCurrentLanguage(language); + platformWrapper?.SetLanguage(language); + } + + public static void RegisterProperties(string key, ITapPropertiesProxy proxy) { + platformWrapper?.RegisterProperties(key, proxy); + } + + public static void AddHost(string host, string replaceHost) { + platformWrapper?.AddHost(host, replaceHost); + } + + public static void UseNativeDataInCore(bool enable) { + platformWrapper?.UseNativeDataInCore(enable); + } + + public static Task UpdateGameAndFailToWebInTapTap(string appId) { + return platformWrapper?.UpdateGameAndFailToWebInTapTap(appId); + } + + public static Task UpdateGameAndFailToWebInTapGlobal(string appId) { + return platformWrapper?.UpdateGameAndFailToWebInTapGlobal(appId); + } + + public static Task UpdateGameAndFailToWebInTapTap(string appId, string webUrl) { + return platformWrapper?.UpdateGameAndFailToWebInTapTap(appId, webUrl); + } + + public static Task UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl) { + return platformWrapper?.UpdateGameAndFailToWebInTapGlobal(appId, webUrl); + } + + public static Task OpenWebDownloadUrlOfTapTap(string appId) { + return platformWrapper?.OpenWebDownloadUrlOfTapTap(appId); + } + + public static Task OpenWebDownloadUrlOfTapGlobal(string appId) { + return platformWrapper?.OpenWebDownloadUrlOfTapGlobal(appId); + } + + public static Task OpenWebDownloadUrl(string url) { + return platformWrapper?.OpenWebDownloadUrl(url); + } + + public static void SetDurationStatisticsEnabled(bool enable) { + platformWrapper?.SetDurationStatisticsEnabled(enable); + } + } +} diff --git a/Runtime/Public/TapCommon.cs.meta b/Runtime/Public/TapCommon.cs.meta new file mode 100644 index 0000000..4ef6cd0 --- /dev/null +++ b/Runtime/Public/TapCommon.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f729b0f8f8508407e8d315deb7a0a748 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapConfig.cs b/Runtime/Public/TapConfig.cs new file mode 100644 index 0000000..6bcd4f5 --- /dev/null +++ b/Runtime/Public/TapConfig.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace TapTap.Common +{ + public class TapConfig + { + public readonly string ClientID; + + public readonly string ClientToken; + + public readonly RegionType RegionType; + + public readonly string ServerURL; + + private TapConfig(string clientID, string clientToken, RegionType regionType, string serverUrl) + { + ClientID = clientID; + ClientToken = clientToken; + ServerURL = serverUrl; + RegionType = regionType; + } + + + + public Dictionary ToDict() { + return new Dictionary { + ["clientID"] = ClientID, + ["clientToken"] = ClientToken, + ["isCN"] = RegionType == RegionType.CN, + }; + } + + public class Builder + { + private string _clientID; + + private string _clientToken; + + private string _serverURL; + + private RegionType _regionType; + + + public Builder() + { + } + + public Builder ClientID(string clientId) + { + _clientID = clientId; + return this; + } + + public Builder ClientToken(string secret) + { + _clientToken = secret; + return this; + } + + public Builder ServerURL(string serverURL) + { + _serverURL = serverURL; + return this; + } + + public Builder RegionType(RegionType type) + { + _regionType = type; + return this; + } + + public TapConfig ConfigBuilder() + { + return new TapConfig(_clientID, _clientToken, _regionType, _serverURL); + } + } + } +} diff --git a/Runtime/Public/TapConfig.cs.meta b/Runtime/Public/TapConfig.cs.meta new file mode 100644 index 0000000..7a772c4 --- /dev/null +++ b/Runtime/Public/TapConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8720ff386886d4c7e81e32584eb11aa6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapError.cs b/Runtime/Public/TapError.cs new file mode 100644 index 0000000..0c0993b --- /dev/null +++ b/Runtime/Public/TapError.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; + +namespace TapTap.Common +{ + public class TapError + { + public int code; + + public string errorDescription; + + public TapError(string json) + { + if (string.IsNullOrEmpty(json)) + { + return; + } + + var dic = Json.Deserialize(json) as Dictionary; + code = SafeDictionary.GetValue(dic, "code"); + errorDescription = SafeDictionary.GetValue(dic, "error_description"); + } + + public TapError() + { + } + + public static TapError SafeConstructorTapError(string json) + { + return string.IsNullOrEmpty(json) ? null : new TapError(json); + } + + public static TapError UndefinedError() + { + return new TapError(TapErrorCode.ERROR_CODE_UNDEFINED, "UnKnown Error"); + } + + public static TapError LoginCancelError() + { + return new TapError(TapErrorCode.ERROR_CODE_LOGIN_CANCEL, "Login Cancel"); + } + + public TapError(int code, string errorDescription) + { + this.code = code; + this.errorDescription = errorDescription; + } + + private static TapErrorCode ParseCode(int parseCode) + { + return Enum.IsDefined(typeof(TapErrorCode), parseCode) + ? (TapErrorCode) Enum.ToObject(typeof(TapErrorCode), parseCode) + : TapErrorCode.ERROR_CODE_UNDEFINED; + } + + public TapError(TapErrorCode code, string errorDescription) + { + this.code = (int) code; + this.errorDescription = errorDescription; + } + } +} \ No newline at end of file diff --git a/Runtime/Public/TapError.cs.meta b/Runtime/Public/TapError.cs.meta new file mode 100644 index 0000000..bc67853 --- /dev/null +++ b/Runtime/Public/TapError.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0476fc01cbd049039fa55776fecba4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapErrorCode.cs b/Runtime/Public/TapErrorCode.cs new file mode 100644 index 0000000..4c5eb3d --- /dev/null +++ b/Runtime/Public/TapErrorCode.cs @@ -0,0 +1,44 @@ +namespace TapTap.Common +{ + public enum TapErrorCode + { + /* + * 未知错误 + */ + ERROR_CODE_UNDEFINED = 80000, + + /** + * SDK 未初始化 + */ + ERROR_CODE_UNINITIALIZED = 80001, + + /** + * 绑定取消 + */ + ERROR_CODE_BIND_CANCEL = 80002, + /** + * 绑定错误 + */ + ERROR_CODE_BIND_ERROR = 80003, + + /** + * 登陆错误 + */ + ERROR_CODE_LOGOUT_INVALID_LOGIN_STATE = 80004, + + /** + * 登陆被踢出 + */ + ERROR_CODE_LOGOUT_KICKED = 80007, + + /** + * 桥接回调错误 + */ + ERROR_CODE_BRIDGE_EXECUTE = 80080, + + /** + * 登录取消 + */ + ERROR_CODE_LOGIN_CANCEL = 80081 + } +} \ No newline at end of file diff --git a/Runtime/Public/TapErrorCode.cs.meta b/Runtime/Public/TapErrorCode.cs.meta new file mode 100644 index 0000000..615b4b7 --- /dev/null +++ b/Runtime/Public/TapErrorCode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4a064453acca4cac9d21618062497da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapException.cs b/Runtime/Public/TapException.cs new file mode 100644 index 0000000..f49cd2a --- /dev/null +++ b/Runtime/Public/TapException.cs @@ -0,0 +1,24 @@ +using System; + +namespace TapTap.Common +{ + public class TapException : Exception + { + public int code; + + public int Code { + get => code; + set { + code = value; + } + } + + public string message; + + public TapException(int code, string message) : base(message) + { + this.code = code; + this.message = message; + } + } +} \ No newline at end of file diff --git a/Runtime/Public/TapException.cs.meta b/Runtime/Public/TapException.cs.meta new file mode 100644 index 0000000..00a350c --- /dev/null +++ b/Runtime/Public/TapException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca6d772e5f50344c28a64d8254a3e058 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapLanguage.cs b/Runtime/Public/TapLanguage.cs new file mode 100644 index 0000000..77d4c59 --- /dev/null +++ b/Runtime/Public/TapLanguage.cs @@ -0,0 +1,21 @@ +namespace TapTap.Common +{ + public enum TapLanguage + { + AUTO = 0, + ZH_HANS = 1, + EN = 2, + ZH_HANT = 3, + JA = 4, + KO = 5, + TH = 6, + ID = 7, + DE = 8, + ES = 9, + FR = 10, + PT = 11, + RU = 12, + TR = 13, + VI = 14 + } +} \ No newline at end of file diff --git a/Runtime/Public/TapLanguage.cs.meta b/Runtime/Public/TapLanguage.cs.meta new file mode 100644 index 0000000..2741023 --- /dev/null +++ b/Runtime/Public/TapLanguage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80862bc85ac5f4bf988d3985469f0b8f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Public/TapLocalizeManager.cs b/Runtime/Public/TapLocalizeManager.cs new file mode 100644 index 0000000..db7a76e --- /dev/null +++ b/Runtime/Public/TapLocalizeManager.cs @@ -0,0 +1,128 @@ +using UnityEngine; + +namespace TapTap.Common +{ + public class TapLocalizeManager + { + private static volatile TapLocalizeManager _instance; + private static readonly object ObjLock = new object(); + + public static TapLocalizeManager Instance + { + get + { + if (_instance != null) return _instance; + lock (ObjLock) + { + if (_instance == null) + { + _instance = new TapLocalizeManager(); + } + } + + return _instance; + } + } + + private TapLanguage _language = TapLanguage.AUTO; + private bool _regionIsCn; + + public static void SetCurrentRegion(bool isCn) + { + Instance._regionIsCn = isCn; + } + + public static void SetCurrentLanguage(TapLanguage language) + { + Instance._language = language; + } + + public static TapLanguage GetCurrentLanguage() + { + if (Instance._language != TapLanguage.AUTO) return Instance._language; + Instance._language = GetSystemLanguage(); + if (Instance._language == TapLanguage.AUTO) + { + Instance._language = Instance._regionIsCn ? TapLanguage.ZH_HANS : TapLanguage.EN; + } + + return Instance._language; + } + + public static string GetCurrentLanguageString() { + TapLanguage lang = GetCurrentLanguage(); + switch (lang) { + case TapLanguage.ZH_HANS: + return "zh_CN"; + case TapLanguage.EN: + return "en_US"; + case TapLanguage.ZH_HANT: + return "zh_TW"; + case TapLanguage.JA: + return "ja_JP"; + case TapLanguage.KO: + return "ko_KR"; + case TapLanguage.TH: + return "th_TH"; + case TapLanguage.ID: + return "id_ID"; + default: + return null; + } + } + + public static string GetCurrentLanguageString2() { + TapLanguage lang = GetCurrentLanguage(); + switch (lang) { + case TapLanguage.ZH_HANS: + return "zh-CN"; + case TapLanguage.EN: + return "en-US"; + case TapLanguage.ZH_HANT: + return "zh-TW"; + case TapLanguage.JA: + return "ja-JP"; + case TapLanguage.KO: + return "ko-KR"; + case TapLanguage.TH: + return "th-TH"; + case TapLanguage.ID: + return "id-ID"; + default: + return null; + } + } + + private static TapLanguage GetSystemLanguage() + { + var lang = TapLanguage.AUTO; + var sysLanguage = Application.systemLanguage; + switch (sysLanguage) + { + case SystemLanguage.ChineseSimplified: + lang = TapLanguage.ZH_HANS; + break; + case SystemLanguage.English: + lang = TapLanguage.EN; + break; + case SystemLanguage.ChineseTraditional: + lang = TapLanguage.ZH_HANT; + break; + case SystemLanguage.Japanese: + lang = TapLanguage.JA; + break; + case SystemLanguage.Korean: + lang = TapLanguage.KO; + break; + case SystemLanguage.Thai: + lang = TapLanguage.TH; + break; + case SystemLanguage.Indonesian: + lang = TapLanguage.ID; + break; + } + + return lang; + } + } +} \ No newline at end of file diff --git a/Runtime/Public/TapLocalizeManager.cs.meta b/Runtime/Public/TapLocalizeManager.cs.meta new file mode 100644 index 0000000..5717792 --- /dev/null +++ b/Runtime/Public/TapLocalizeManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 555942061f1f94647b8b4093230892ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/TapTap.Common.Runtime.asmdef b/Runtime/TapTap.Common.Runtime.asmdef new file mode 100644 index 0000000..e1ce714 --- /dev/null +++ b/Runtime/TapTap.Common.Runtime.asmdef @@ -0,0 +1,3 @@ +{ + "name": "TapTap.Common.Runtime" +} diff --git a/Runtime/TapTap.Common.Runtime.asmdef.meta b/Runtime/TapTap.Common.Runtime.asmdef.meta new file mode 100644 index 0000000..b686b0c --- /dev/null +++ b/Runtime/TapTap.Common.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b3f64ec33f5b4da98a17367a35b82f2 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone.meta b/Standalone.meta new file mode 100644 index 0000000..515164a --- /dev/null +++ b/Standalone.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10326fc7343d54dd5add4478c812df6e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone/Editor.meta b/Standalone/Editor.meta new file mode 100644 index 0000000..8185488 --- /dev/null +++ b/Standalone/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0de138494fd246ebb8b03702210bbd3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone/Editor/TapCommonStandaloneProcessBuild.cs b/Standalone/Editor/TapCommonStandaloneProcessBuild.cs new file mode 100644 index 0000000..4d1240a --- /dev/null +++ b/Standalone/Editor/TapCommonStandaloneProcessBuild.cs @@ -0,0 +1,20 @@ +using System; +using UnityEditor.Build.Reporting; +using TapTap.Common.Editor; + +namespace TapTap.Common.Editor { + public class TapCommonStandaloneProcessBuild : SDKLinkProcessBuild { + public override int callbackOrder => 0; + + public override string LinkPath => "TapTap/Common/link.xml"; + + public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] { + new LinkedAssembly { Fullname = "TapTap.Common.Runtime" }, + new LinkedAssembly { Fullname = "TapTap.Common.Standalone.Runtime" } + }; + + public override Func IsTargetPlatform => (report) => { + return BuildTargetUtils.IsSupportStandalone(report.summary.platform); + }; + } +} \ No newline at end of file diff --git a/Standalone/Editor/TapCommonStandaloneProcessBuild.cs.meta b/Standalone/Editor/TapCommonStandaloneProcessBuild.cs.meta new file mode 100644 index 0000000..ce06c06 --- /dev/null +++ b/Standalone/Editor/TapCommonStandaloneProcessBuild.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7884113b077534bc292756cb15a01c07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone/Editor/TapTap.Common.Standalone.Editor.asmdef b/Standalone/Editor/TapTap.Common.Standalone.Editor.asmdef new file mode 100644 index 0000000..602ce70 --- /dev/null +++ b/Standalone/Editor/TapTap.Common.Standalone.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "TapTap.Common.Standalone.Editor", + "references": [ + "GUID:616cea76def2d4f059b94440fc8cc03d" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Standalone/Editor/TapTap.Common.Standalone.Editor.asmdef.meta b/Standalone/Editor/TapTap.Common.Standalone.Editor.asmdef.meta new file mode 100644 index 0000000..9e6027b --- /dev/null +++ b/Standalone/Editor/TapTap.Common.Standalone.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0e2ac1c9852644cb7a25bcddb1b5328a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone/Runtime.meta b/Standalone/Runtime.meta new file mode 100644 index 0000000..250d54a --- /dev/null +++ b/Standalone/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fcfb6647f2f464ef4bddf0aaf541abd9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone/Runtime/TapCommonStandalone.cs b/Standalone/Runtime/TapCommonStandalone.cs new file mode 100644 index 0000000..8cd1fbe --- /dev/null +++ b/Standalone/Runtime/TapCommonStandalone.cs @@ -0,0 +1,78 @@ +using System; +using System.Threading.Tasks; +using TapTap.Common.Internal; + +namespace TapTap.Common.Standalone { + public class TapCommonStandalone : ITapCommonPlatform { + public void AddHost(string host, string replaceHost) { + } + + public void GetRegionCode(Action callback) { + } + + public void Init(TapConfig config) { + } + + public void IsTapTapGlobalInstalled(Action callback) { + } + + public void IsTapTapInstalled(Action callback) { + } + + public void OpenReviewInTapGlobal(string appId, Action callback) { + } + + public void OpenReviewInTapTap(string appId, Action callback) { + } + + public Task OpenWebDownloadUrl(string url) { + return Task.FromResult(true); + } + + public Task OpenWebDownloadUrlOfTapGlobal(string appId) { + return Task.FromResult(true); + } + + public Task OpenWebDownloadUrlOfTapTap(string appId) { + return Task.FromResult(true); + } + + public void RegisterProperties(string key, ITapPropertiesProxy proxy) { + } + + public void UseNativeDataInCore(bool enable) { + } + + public void SetDurationStatisticsEnabled(bool enable) { + TapCommon.DisableDurationStatistics = !enable; + } + + public void SetLanguage(TapLanguage language) { + } + + public void SetXua() { + } + + public Task UpdateGameAndFailToWebInTapGlobal(string appId) { + return Task.FromResult(true); + } + + public Task UpdateGameAndFailToWebInTapGlobal(string appId, string webUrl) { + return Task.FromResult(true); + } + + public Task UpdateGameAndFailToWebInTapTap(string appId) { + return Task.FromResult(true); + } + + public Task UpdateGameAndFailToWebInTapTap(string appId, string webUrl) { + return Task.FromResult(true); + } + + public void UpdateGameInTapGlobal(string appId, Action callback) { + } + + public void UpdateGameInTapTap(string appId, Action callback) { + } + } +} diff --git a/Standalone/Runtime/TapCommonStandalone.cs.meta b/Standalone/Runtime/TapCommonStandalone.cs.meta new file mode 100644 index 0000000..81e7ecd --- /dev/null +++ b/Standalone/Runtime/TapCommonStandalone.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 707d6cb155e7a4ff0bd7198408573037 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Standalone/Runtime/TapTap.Common.Standalone.Runtime.asmdef b/Standalone/Runtime/TapTap.Common.Standalone.Runtime.asmdef new file mode 100644 index 0000000..cfd3edf --- /dev/null +++ b/Standalone/Runtime/TapTap.Common.Standalone.Runtime.asmdef @@ -0,0 +1,21 @@ +{ + "name": "TapTap.Common.Standalone.Runtime", + "references": [ + "GUID:0b3f64ec33f5b4da98a17367a35b82f2" + ], + "includePlatforms": [ + "Editor", + "LinuxStandalone64", + "macOSStandalone", + "WindowsStandalone32", + "WindowsStandalone64" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Standalone/Runtime/TapTap.Common.Standalone.Runtime.asmdef.meta b/Standalone/Runtime/TapTap.Common.Standalone.Runtime.asmdef.meta new file mode 100644 index 0000000..0f70ec7 --- /dev/null +++ b/Standalone/Runtime/TapTap.Common.Standalone.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 565636017c7c040039f0fa8ac8d38122 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VERSIONNOTE.md b/VERSIONNOTE.md new file mode 100644 index 0000000..e69de29 diff --git a/VERSIONNOTE.md.meta b/VERSIONNOTE.md.meta new file mode 100644 index 0000000..c0e111d --- /dev/null +++ b/VERSIONNOTE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8f641ea9398ec4290be0e2a577551514 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..ffd4bcb --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "com.taptap.tds.common", + "displayName": "TapTap Common", + "description": "TapTap Develop Service", + "version": "3.24.1", + "unity": "2018.3", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.leancloud.storage": "https://github.com/leancloud/csharp-sdk-upm.git#storage-0.10.14" + }, + "license": "MIT" +} diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..6a84ce1 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 863b7a574870c4ea29a8c63b01b1b63b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: