com.taptap.sdk.core 4.9.4 → 4.10.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Mobile/Editor/NativeDependencies.xml +3 -3
- package/Runtime/Public/DataStorage.cs +0 -8
- package/Runtime/Public/TapTapSDK.cs +34 -53
- package/Runtime/Public/TapTapSdkOptions.cs +0 -24
- package/Standalone/Plugins/x86_64/taptap_api.dll +0 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs +0 -17
- package/Standalone/Runtime/Internal/Http/TapHttp.cs +41 -4
- package/Standalone/Runtime/Internal/Openlog/TapOpenlogWrapper.cs +2 -4
- package/package.json +9 -6
- package/Resources/Fonts/tapsdk_shader.shader +0 -127
- package/Resources/Fonts/tapsdk_shader.shader.meta +0 -10
- package/Resources/Fonts/tapsdk_text_material.mat +0 -97
- package/Resources/Fonts/tapsdk_text_material.mat.meta +0 -8
- package/link.xml +0 -4
- package/link.xml.meta +0 -7
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
2
|
<dependencies>
|
|
3
3
|
<androidPackages>
|
|
4
4
|
<repositories>
|
|
5
5
|
<repository>https://repo.maven.apache.org/maven2</repository>
|
|
6
6
|
</repositories>
|
|
7
|
-
<androidPackage spec="com.taptap.sdk:tap-core-unity:4.
|
|
7
|
+
<androidPackage spec="com.taptap.sdk:tap-core-unity:4.10.0-beta.1"/>
|
|
8
8
|
</androidPackages>
|
|
9
9
|
<iosPods>
|
|
10
10
|
<sources>
|
|
11
11
|
<source>https://github.com/CocoaPods/Specs.git</source>
|
|
12
12
|
</sources>
|
|
13
|
-
<iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapSDK/Core" version="4.
|
|
13
|
+
<iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapSDK/Core" version="4.10.0-beta.1"/>
|
|
14
14
|
</iosPods>
|
|
15
15
|
</dependencies>
|
|
@@ -13,9 +13,6 @@ namespace TapSDK.Core
|
|
|
13
13
|
{
|
|
14
14
|
private static Dictionary<string, string> dataCache;
|
|
15
15
|
private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
|
|
16
|
-
|
|
17
|
-
// 缓存 MacAddress,避免多次获取
|
|
18
|
-
private static string cachedMacAddress;
|
|
19
16
|
public static void SaveString(string key, string value)
|
|
20
17
|
{
|
|
21
18
|
string storageKey = GenerateStorageKey(key);
|
|
@@ -138,10 +135,6 @@ namespace TapSDK.Core
|
|
|
138
135
|
|
|
139
136
|
private static string GetMacAddress()
|
|
140
137
|
{
|
|
141
|
-
if (!string.IsNullOrEmpty(cachedMacAddress))
|
|
142
|
-
{
|
|
143
|
-
return cachedMacAddress;
|
|
144
|
-
}
|
|
145
138
|
string physicalAddress = "FFFFFFFFFFFF";
|
|
146
139
|
if (Platform.IsAndroid() || Platform.IsIOS())
|
|
147
140
|
{
|
|
@@ -166,7 +159,6 @@ namespace TapSDK.Core
|
|
|
166
159
|
};
|
|
167
160
|
}
|
|
168
161
|
}
|
|
169
|
-
cachedMacAddress = physicalAddress;
|
|
170
162
|
return physicalAddress;
|
|
171
163
|
}
|
|
172
164
|
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
using System;
|
|
2
|
-
using System.
|
|
2
|
+
using System.Collections.Generic;
|
|
3
3
|
using System.Linq;
|
|
4
|
+
using System.Threading.Tasks;
|
|
4
5
|
using TapSDK.Core.Internal;
|
|
5
|
-
using System.Collections.Generic;
|
|
6
|
-
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
using System.Reflection;
|
|
9
6
|
using TapSDK.Core.Internal.Init;
|
|
10
7
|
using TapSDK.Core.Internal.Log;
|
|
11
|
-
using
|
|
8
|
+
using UnityEngine;
|
|
9
|
+
|
|
10
|
+
namespace TapSDK.Core
|
|
11
|
+
{
|
|
12
|
+
public class TapTapSDK
|
|
13
|
+
{
|
|
14
|
+
public static readonly string Version = "4.10.0-beta.1";
|
|
12
15
|
|
|
13
|
-
namespace TapSDK.Core {
|
|
14
|
-
public class TapTapSDK {
|
|
15
|
-
public static readonly string Version = "4.9.3";
|
|
16
|
-
|
|
17
16
|
public static string SDKPlatform = "TapSDK-Unity";
|
|
18
17
|
|
|
19
18
|
public static TapTapSdkOptions taptapSdkOptions;
|
|
@@ -22,16 +21,19 @@ namespace TapSDK.Core {
|
|
|
22
21
|
|
|
23
22
|
private static bool disableDurationStatistics;
|
|
24
23
|
|
|
25
|
-
public static bool DisableDurationStatistics
|
|
24
|
+
public static bool DisableDurationStatistics
|
|
25
|
+
{
|
|
26
26
|
get => disableDurationStatistics;
|
|
27
|
-
set {
|
|
28
|
-
disableDurationStatistics = value;
|
|
29
|
-
}
|
|
27
|
+
set { disableDurationStatistics = value; }
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
static TapTapSDK()
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
static TapTapSDK()
|
|
31
|
+
{
|
|
32
|
+
platformWrapper =
|
|
33
|
+
PlatformTypeUtils.CreatePlatformImplementationObject(
|
|
34
|
+
typeof(ITapCorePlatform),
|
|
35
|
+
"TapSDK.Core"
|
|
36
|
+
) as ITapCorePlatform;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
public static void Init(TapTapSdkOptions coreOption)
|
|
@@ -71,7 +73,6 @@ namespace TapSDK.Core {
|
|
|
71
73
|
TapLog.Enabled = coreOption.enableLog;
|
|
72
74
|
platformWrapper?.Init(coreOption, otherOptions);
|
|
73
75
|
|
|
74
|
-
|
|
75
76
|
Type[] initTaskTypes = GetInitTypeList();
|
|
76
77
|
if (initTaskTypes != null)
|
|
77
78
|
{
|
|
@@ -96,7 +97,10 @@ namespace TapSDK.Core {
|
|
|
96
97
|
/// <param name="coreOption"></param>
|
|
97
98
|
/// <param name="otherOptions"></param>
|
|
98
99
|
/// <returns>TapEvent 属性</returns>
|
|
99
|
-
private static TapTapEventOptions HandleEventOptions(
|
|
100
|
+
private static TapTapEventOptions HandleEventOptions(
|
|
101
|
+
TapTapSdkOptions coreOption,
|
|
102
|
+
TapTapSdkBaseOptions[] otherOptions = null
|
|
103
|
+
)
|
|
100
104
|
{
|
|
101
105
|
TapTapEventOptions tapEventOptions = null;
|
|
102
106
|
if (otherOptions != null && otherOptions.Length > 0)
|
|
@@ -115,38 +119,14 @@ namespace TapSDK.Core {
|
|
|
115
119
|
if (coreOption != null)
|
|
116
120
|
{
|
|
117
121
|
tapEventOptions.channel = coreOption.channel;
|
|
118
|
-
tapEventOptions.disableAutoLogDeviceLogin =
|
|
122
|
+
tapEventOptions.disableAutoLogDeviceLogin =
|
|
123
|
+
coreOption.disableAutoLogDeviceLogin;
|
|
119
124
|
tapEventOptions.enableAutoIAPEvent = coreOption.enableAutoIAPEvent;
|
|
120
|
-
tapEventOptions.overrideBuiltInParameters =
|
|
125
|
+
tapEventOptions.overrideBuiltInParameters =
|
|
126
|
+
coreOption.overrideBuiltInParameters;
|
|
121
127
|
tapEventOptions.propertiesJson = coreOption.propertiesJson;
|
|
122
|
-
tapEventOptions.caid = coreOption.caid;
|
|
123
|
-
tapEventOptions.enableAdvertiserIDCollection = coreOption.enableAdvertiserIDCollection;
|
|
124
|
-
tapEventOptions.oaidCert = coreOption.oaidCert;
|
|
125
|
-
tapEventOptions.disableReflectionOAID = coreOption.disableReflectionOAID;
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
else
|
|
129
|
-
{
|
|
130
|
-
if (
|
|
131
|
-
string.IsNullOrEmpty(tapEventOptions.caid)
|
|
132
|
-
&& !string.IsNullOrEmpty(coreOption.caid)
|
|
133
|
-
)
|
|
134
|
-
{
|
|
135
|
-
tapEventOptions.caid = coreOption.caid;
|
|
136
|
-
}
|
|
137
|
-
tapEventOptions.enableAdvertiserIDCollection =
|
|
138
|
-
tapEventOptions.enableAdvertiserIDCollection || coreOption.enableAdvertiserIDCollection;
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
string.IsNullOrEmpty(tapEventOptions.oaidCert)
|
|
142
|
-
&& !string.IsNullOrEmpty(coreOption.oaidCert)
|
|
143
|
-
)
|
|
144
|
-
{
|
|
145
|
-
tapEventOptions.oaidCert = coreOption.oaidCert;
|
|
146
|
-
}
|
|
147
|
-
tapEventOptions.disableReflectionOAID =
|
|
148
|
-
tapEventOptions.disableReflectionOAID && coreOption.disableReflectionOAID;
|
|
149
|
-
}
|
|
150
130
|
return tapEventOptions;
|
|
151
131
|
}
|
|
152
132
|
|
|
@@ -155,16 +135,18 @@ namespace TapSDK.Core {
|
|
|
155
135
|
{
|
|
156
136
|
platformWrapper?.UpdateLanguage(language);
|
|
157
137
|
}
|
|
158
|
-
|
|
138
|
+
|
|
159
139
|
// 是否通过 PC 启动器唤起游戏
|
|
160
140
|
public static Task<bool> IsLaunchedFromTapTapPC()
|
|
161
141
|
{
|
|
162
142
|
return platformWrapper?.IsLaunchedFromTapTapPC();
|
|
163
143
|
}
|
|
164
144
|
|
|
165
|
-
private static Type[] GetInitTypeList()
|
|
145
|
+
private static Type[] GetInitTypeList()
|
|
146
|
+
{
|
|
166
147
|
Type interfaceType = typeof(IInitTask);
|
|
167
|
-
Type[] initTaskTypes = AppDomain
|
|
148
|
+
Type[] initTaskTypes = AppDomain
|
|
149
|
+
.CurrentDomain.GetAssemblies()
|
|
168
150
|
.Where(asssembly => asssembly.GetName().FullName.StartsWith("TapSDK"))
|
|
169
151
|
.SelectMany(assembly => assembly.GetTypes())
|
|
170
152
|
.Where(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass)
|
|
@@ -178,9 +160,8 @@ namespace TapSDK.Core {
|
|
|
178
160
|
string action,
|
|
179
161
|
Dictionary<string, string> properties = null
|
|
180
162
|
)
|
|
181
|
-
|
|
182
|
-
|
|
163
|
+
{
|
|
164
|
+
platformWrapper.SendOpenLog(project, version, action, properties);
|
|
183
165
|
}
|
|
184
|
-
|
|
185
166
|
}
|
|
186
167
|
}
|
|
@@ -74,7 +74,6 @@ namespace TapSDK.Core
|
|
|
74
74
|
/// <summary>
|
|
75
75
|
/// CAID,仅国内 iOS
|
|
76
76
|
/// </summary>
|
|
77
|
-
[Obsolete("该属性已废弃,请在 TapTapEventOptions 设置对应属性")]
|
|
78
77
|
public string caid = null;
|
|
79
78
|
/// <summary>
|
|
80
79
|
/// 是否能够覆盖内置参数,默认为 false
|
|
@@ -84,7 +83,6 @@ namespace TapSDK.Core
|
|
|
84
83
|
/// <summary>
|
|
85
84
|
/// 是否开启广告商 ID 收集,默认为 false
|
|
86
85
|
/// </summary>
|
|
87
|
-
[Obsolete("该属性已废弃,请在 TapTapEventOptions 设置对应属性")]
|
|
88
86
|
public bool enableAdvertiserIDCollection = false;
|
|
89
87
|
/// <summary>
|
|
90
88
|
/// 是否开启自动上报 IAP 事件
|
|
@@ -94,7 +92,6 @@ namespace TapSDK.Core
|
|
|
94
92
|
/// <summary>
|
|
95
93
|
/// OAID证书, 仅 Android,用于上报 OAID 仅 [TapTapRegion.CN] 生效
|
|
96
94
|
/// </summary>
|
|
97
|
-
[Obsolete("该属性已废弃,请在 TapTapEventOptions 设置对应属性")]
|
|
98
95
|
public string oaidCert = null;
|
|
99
96
|
/// <summary>
|
|
100
97
|
/// 是否开启日志,Release 版本请设置为 false
|
|
@@ -104,7 +101,6 @@ namespace TapSDK.Core
|
|
|
104
101
|
/// <summary>
|
|
105
102
|
/// 是否禁用 OAID 反射
|
|
106
103
|
/// </summary>
|
|
107
|
-
[Obsolete("该属性已废弃,请在 TapTapEventOptions 设置对应属性")]
|
|
108
104
|
public bool disableReflectionOAID = true;
|
|
109
105
|
|
|
110
106
|
/// <summary>
|
|
@@ -160,26 +156,6 @@ namespace TapSDK.Core
|
|
|
160
156
|
/// </summary>
|
|
161
157
|
public bool disableAutoLogDeviceLogin = false;
|
|
162
158
|
|
|
163
|
-
/// <summary>
|
|
164
|
-
/// CAID,仅国内 iOS
|
|
165
|
-
/// </summary>
|
|
166
|
-
public string caid = null;
|
|
167
|
-
|
|
168
|
-
/// <summary>
|
|
169
|
-
/// 是否开启广告商 ID 收集,默认为 false
|
|
170
|
-
/// </summary>
|
|
171
|
-
public bool enableAdvertiserIDCollection = false;
|
|
172
|
-
|
|
173
|
-
/// <summary>
|
|
174
|
-
/// OAID证书, 仅 Android,用于上报 OAID 仅 [TapTapRegion.CN] 生效
|
|
175
|
-
/// </summary>
|
|
176
|
-
public string oaidCert = null;
|
|
177
|
-
|
|
178
|
-
/// <summary>
|
|
179
|
-
/// 是否禁用 OAID 反射
|
|
180
|
-
/// </summary>
|
|
181
|
-
public bool disableReflectionOAID = true;
|
|
182
|
-
|
|
183
159
|
[JsonProperty("moduleName")]
|
|
184
160
|
private string _moduleName = "TapTapEvent";
|
|
185
161
|
[JsonIgnore]
|
|
Binary file
|
|
@@ -11,11 +11,6 @@ namespace TapSDK.Core.Standalone.Internal
|
|
|
11
11
|
{
|
|
12
12
|
public class DeviceInfo
|
|
13
13
|
{
|
|
14
|
-
// 缓存网卡地址列表,避免多次调用
|
|
15
|
-
private static string cachedMacAddressList;
|
|
16
|
-
|
|
17
|
-
// 缓存网卡地址,避免多次调用
|
|
18
|
-
private static string cachedFristMacAddress;
|
|
19
14
|
|
|
20
15
|
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
|
|
21
16
|
[DllImport("TapDBDeviceInfo", CallingConvention = CallingConvention.Cdecl)]
|
|
@@ -73,15 +68,6 @@ namespace TapSDK.Core.Standalone.Internal
|
|
|
73
68
|
|
|
74
69
|
public static void GetMacAddress(out string macAddressList, out string firstMacAddress)
|
|
75
70
|
{
|
|
76
|
-
if (
|
|
77
|
-
!string.IsNullOrEmpty(cachedMacAddressList)
|
|
78
|
-
&& !string.IsNullOrEmpty(cachedFristMacAddress)
|
|
79
|
-
)
|
|
80
|
-
{
|
|
81
|
-
macAddressList = cachedMacAddressList;
|
|
82
|
-
firstMacAddress = cachedFristMacAddress;
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
71
|
List<string> mac_addrs = new List<string>();
|
|
86
72
|
|
|
87
73
|
try
|
|
@@ -106,9 +92,6 @@ namespace TapSDK.Core.Standalone.Internal
|
|
|
106
92
|
}
|
|
107
93
|
macAddressList = $"[{string.Join(",", mac_addrs)}]";
|
|
108
94
|
firstMacAddress = mac_addrs.Count > 0 ? mac_addrs[0].Replace("\"", "") : string.Empty;
|
|
109
|
-
|
|
110
|
-
cachedMacAddressList = macAddressList;
|
|
111
|
-
cachedFristMacAddress = firstMacAddress;
|
|
112
95
|
}
|
|
113
96
|
|
|
114
97
|
private static string toMd5(string data)
|
|
@@ -11,7 +11,6 @@ namespace TapSDK.Core.Standalone.Internal.Http
|
|
|
11
11
|
using System.Threading.Tasks;
|
|
12
12
|
using Newtonsoft.Json;
|
|
13
13
|
using TapSDK.Core.Internal.Log;
|
|
14
|
-
using UnityEngine;
|
|
15
14
|
|
|
16
15
|
public class TapHttp
|
|
17
16
|
{
|
|
@@ -392,9 +391,47 @@ namespace TapSDK.Core.Standalone.Internal.Http
|
|
|
392
391
|
}
|
|
393
392
|
|
|
394
393
|
// 判断网络连接状态
|
|
395
|
-
private bool CheckNetworkConnection()
|
|
396
|
-
|
|
397
|
-
|
|
394
|
+
private bool CheckNetworkConnection(){
|
|
395
|
+
try {
|
|
396
|
+
var networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
|
|
397
|
+
|
|
398
|
+
foreach (var netInterface in networkInterfaces)
|
|
399
|
+
{
|
|
400
|
+
// 忽略虚拟网卡
|
|
401
|
+
if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Loopback ||
|
|
402
|
+
netInterface.NetworkInterfaceType == NetworkInterfaceType.Tunnel)
|
|
403
|
+
{
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// 检查是否有网络连接
|
|
408
|
+
if (netInterface.OperationalStatus == OperationalStatus.Up)
|
|
409
|
+
{
|
|
410
|
+
// 检查是否有有效的 IPv4 地址
|
|
411
|
+
var ipProperties = netInterface.GetIPProperties();
|
|
412
|
+
var ipv4Address = ipProperties.UnicastAddresses.FirstOrDefault(ip => ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);
|
|
413
|
+
|
|
414
|
+
if (ipv4Address != null)
|
|
415
|
+
{
|
|
416
|
+
// 有有效的 IP 地址,则说明已连接到网络
|
|
417
|
+
if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
|
|
418
|
+
{
|
|
419
|
+
return true; // 有线连接
|
|
420
|
+
}
|
|
421
|
+
else if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211)
|
|
422
|
+
{
|
|
423
|
+
return true; // 无线连接
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return false; // 无连接
|
|
430
|
+
}catch(Exception e){
|
|
431
|
+
TapLog.Log("checkout network connected error = " + e);
|
|
432
|
+
// 发生异常时,当做有网处理
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
398
435
|
}
|
|
399
436
|
}
|
|
400
437
|
}
|
|
@@ -5,12 +5,11 @@ namespace TapSDK.Core.Standalone.Internal.Openlog
|
|
|
5
5
|
{
|
|
6
6
|
internal class TapOpenlogWrapper
|
|
7
7
|
{
|
|
8
|
+
|
|
8
9
|
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
|
|
9
10
|
internal const string DllName = "tapsdkcore";
|
|
10
11
|
#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
|
|
11
12
|
internal const string DllName = "libtapsdkcorecpp";
|
|
12
|
-
#elif UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX
|
|
13
|
-
internal const string DllName = "libtapsdkcorecpp";
|
|
14
13
|
#endif
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -69,8 +68,7 @@ namespace TapSDK.Core.Standalone.Internal.Openlog
|
|
|
69
68
|
* 成功返回 0,失败返回 -1
|
|
70
69
|
*/
|
|
71
70
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
|
72
|
-
internal static extern int TdkOnAppStarted(string cfg, CommonVariablesGetter commonVariablesGetter,
|
|
73
|
-
FreeStringCallback freeString);
|
|
71
|
+
internal static extern int TdkOnAppStarted(string cfg, CommonVariablesGetter commonVariablesGetter, FreeStringCallback freeString);
|
|
74
72
|
|
|
75
73
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
76
74
|
internal delegate IntPtr CommonVariablesGetter();
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"name": "com.taptap.sdk.core",
|
|
3
|
+
"displayName": "TapTapSDK Core",
|
|
4
|
+
"description": "TapTapSDK Core",
|
|
5
|
+
"version": "4.10.0-beta.1",
|
|
6
|
+
"unity": "2019.4",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"com.google.external-dependency-manager": "1.2.179"
|
|
10
|
+
}
|
|
8
11
|
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
|
|
2
|
-
|
|
3
|
-
Shader "TapSDK/Default"
|
|
4
|
-
{
|
|
5
|
-
Properties
|
|
6
|
-
{
|
|
7
|
-
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
|
|
8
|
-
_Color ("Tint", Color) = (1,1,1,1)
|
|
9
|
-
|
|
10
|
-
_StencilComp ("Stencil Comparison", Float) = 8
|
|
11
|
-
_Stencil ("Stencil ID", Float) = 0
|
|
12
|
-
_StencilOp ("Stencil Operation", Float) = 0
|
|
13
|
-
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
|
14
|
-
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
|
15
|
-
|
|
16
|
-
_ColorMask ("Color Mask", Float) = 15
|
|
17
|
-
|
|
18
|
-
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
SubShader
|
|
22
|
-
{
|
|
23
|
-
Tags
|
|
24
|
-
{
|
|
25
|
-
"Queue"="Transparent"
|
|
26
|
-
"IgnoreProjector"="True"
|
|
27
|
-
"RenderType"="Transparent"
|
|
28
|
-
"PreviewType"="Plane"
|
|
29
|
-
"CanUseSpriteAtlas"="True"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Stencil
|
|
33
|
-
{
|
|
34
|
-
Ref [_Stencil]
|
|
35
|
-
Comp [_StencilComp]
|
|
36
|
-
Pass [_StencilOp]
|
|
37
|
-
ReadMask [_StencilReadMask]
|
|
38
|
-
WriteMask [_StencilWriteMask]
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Cull Off
|
|
42
|
-
Lighting Off
|
|
43
|
-
ZWrite Off
|
|
44
|
-
ZTest [unity_GUIZTestMode]
|
|
45
|
-
Blend SrcAlpha OneMinusSrcAlpha
|
|
46
|
-
ColorMask [_ColorMask]
|
|
47
|
-
|
|
48
|
-
Pass
|
|
49
|
-
{
|
|
50
|
-
Name "Default"
|
|
51
|
-
CGPROGRAM
|
|
52
|
-
#pragma vertex vert
|
|
53
|
-
#pragma fragment frag
|
|
54
|
-
#pragma target 2.0
|
|
55
|
-
|
|
56
|
-
#include "UnityCG.cginc"
|
|
57
|
-
#include "UnityUI.cginc"
|
|
58
|
-
|
|
59
|
-
#pragma multi_compile_local _ UNITY_UI_CLIP_RECT
|
|
60
|
-
#pragma multi_compile_local _ UNITY_UI_ALPHACLIP
|
|
61
|
-
|
|
62
|
-
struct appdata_t
|
|
63
|
-
{
|
|
64
|
-
float4 vertex : POSITION;
|
|
65
|
-
float4 color : COLOR;
|
|
66
|
-
float2 texcoord : TEXCOORD0;
|
|
67
|
-
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
struct v2f
|
|
71
|
-
{
|
|
72
|
-
float4 vertex : SV_POSITION;
|
|
73
|
-
fixed4 color : COLOR;
|
|
74
|
-
float2 texcoord : TEXCOORD0;
|
|
75
|
-
float4 worldPosition : TEXCOORD1;
|
|
76
|
-
float4 mask : TEXCOORD2;
|
|
77
|
-
UNITY_VERTEX_OUTPUT_STEREO
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
sampler2D _MainTex;
|
|
81
|
-
fixed4 _Color;
|
|
82
|
-
fixed4 _TextureSampleAdd;
|
|
83
|
-
float4 _ClipRect;
|
|
84
|
-
float4 _MainTex_ST;
|
|
85
|
-
float _UIMaskSoftnessX;
|
|
86
|
-
float _UIMaskSoftnessY;
|
|
87
|
-
|
|
88
|
-
v2f vert(appdata_t v)
|
|
89
|
-
{
|
|
90
|
-
v2f OUT;
|
|
91
|
-
UNITY_SETUP_INSTANCE_ID(v);
|
|
92
|
-
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
|
|
93
|
-
float4 vPosition = UnityObjectToClipPos(v.vertex);
|
|
94
|
-
OUT.worldPosition = v.vertex;
|
|
95
|
-
OUT.vertex = vPosition;
|
|
96
|
-
|
|
97
|
-
float2 pixelSize = vPosition.w;
|
|
98
|
-
pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
|
|
99
|
-
|
|
100
|
-
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
|
|
101
|
-
float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
|
|
102
|
-
OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex);
|
|
103
|
-
OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy)));
|
|
104
|
-
|
|
105
|
-
OUT.color = v.color * _Color;
|
|
106
|
-
return OUT;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
fixed4 frag(v2f IN) : SV_Target
|
|
110
|
-
{
|
|
111
|
-
half4 color = IN.color * (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
|
|
112
|
-
|
|
113
|
-
#ifdef UNITY_UI_CLIP_RECT
|
|
114
|
-
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw);
|
|
115
|
-
color.a *= m.x * m.y;
|
|
116
|
-
#endif
|
|
117
|
-
|
|
118
|
-
#ifdef UNITY_UI_ALPHACLIP
|
|
119
|
-
clip (color.a - 0.001);
|
|
120
|
-
#endif
|
|
121
|
-
|
|
122
|
-
return color;
|
|
123
|
-
}
|
|
124
|
-
ENDCG
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
%YAML 1.1
|
|
2
|
-
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
-
--- !u!21 &2100000
|
|
4
|
-
Material:
|
|
5
|
-
serializedVersion: 6
|
|
6
|
-
m_ObjectHideFlags: 0
|
|
7
|
-
m_CorrespondingSourceObject: {fileID: 0}
|
|
8
|
-
m_PrefabInstance: {fileID: 0}
|
|
9
|
-
m_PrefabAsset: {fileID: 0}
|
|
10
|
-
m_Name: tapsdk_text_material
|
|
11
|
-
m_Shader: {fileID: 4800000, guid: b3c067c0e17de4e4c877649ed2d40608, type: 3}
|
|
12
|
-
m_ShaderKeywords:
|
|
13
|
-
m_LightmapFlags: 4
|
|
14
|
-
m_EnableInstancingVariants: 0
|
|
15
|
-
m_DoubleSidedGI: 0
|
|
16
|
-
m_CustomRenderQueue: -1
|
|
17
|
-
stringTagMap: {}
|
|
18
|
-
disabledShaderPasses: []
|
|
19
|
-
m_SavedProperties:
|
|
20
|
-
serializedVersion: 3
|
|
21
|
-
m_TexEnvs:
|
|
22
|
-
- _BumpMap:
|
|
23
|
-
m_Texture: {fileID: 0}
|
|
24
|
-
m_Scale: {x: 1, y: 1}
|
|
25
|
-
m_Offset: {x: 0, y: 0}
|
|
26
|
-
- _DetailAlbedoMap:
|
|
27
|
-
m_Texture: {fileID: 0}
|
|
28
|
-
m_Scale: {x: 1, y: 1}
|
|
29
|
-
m_Offset: {x: 0, y: 0}
|
|
30
|
-
- _DetailMask:
|
|
31
|
-
m_Texture: {fileID: 0}
|
|
32
|
-
m_Scale: {x: 1, y: 1}
|
|
33
|
-
m_Offset: {x: 0, y: 0}
|
|
34
|
-
- _DetailNormalMap:
|
|
35
|
-
m_Texture: {fileID: 0}
|
|
36
|
-
m_Scale: {x: 1, y: 1}
|
|
37
|
-
m_Offset: {x: 0, y: 0}
|
|
38
|
-
- _EmissionMap:
|
|
39
|
-
m_Texture: {fileID: 0}
|
|
40
|
-
m_Scale: {x: 1, y: 1}
|
|
41
|
-
m_Offset: {x: 0, y: 0}
|
|
42
|
-
- _FaceTex:
|
|
43
|
-
m_Texture: {fileID: 0}
|
|
44
|
-
m_Scale: {x: 1, y: 1}
|
|
45
|
-
m_Offset: {x: 0, y: 0}
|
|
46
|
-
- _MainTex:
|
|
47
|
-
m_Texture: {fileID: 0}
|
|
48
|
-
m_Scale: {x: 1, y: 1}
|
|
49
|
-
m_Offset: {x: 0, y: 0}
|
|
50
|
-
- _MetallicGlossMap:
|
|
51
|
-
m_Texture: {fileID: 0}
|
|
52
|
-
m_Scale: {x: 1, y: 1}
|
|
53
|
-
m_Offset: {x: 0, y: 0}
|
|
54
|
-
- _OcclusionMap:
|
|
55
|
-
m_Texture: {fileID: 0}
|
|
56
|
-
m_Scale: {x: 1, y: 1}
|
|
57
|
-
m_Offset: {x: 0, y: 0}
|
|
58
|
-
- _ParallaxMap:
|
|
59
|
-
m_Texture: {fileID: 0}
|
|
60
|
-
m_Scale: {x: 1, y: 1}
|
|
61
|
-
m_Offset: {x: 0, y: 0}
|
|
62
|
-
m_Floats:
|
|
63
|
-
- _BumpScale: 1
|
|
64
|
-
- _ColorMask: 15
|
|
65
|
-
- _CullMode: 0
|
|
66
|
-
- _Cutoff: 0.5
|
|
67
|
-
- _DetailNormalMapScale: 1
|
|
68
|
-
- _DiffusePower: 1
|
|
69
|
-
- _DstBlend: 0
|
|
70
|
-
- _GlossMapScale: 1
|
|
71
|
-
- _Glossiness: 0.5
|
|
72
|
-
- _GlossyReflections: 1
|
|
73
|
-
- _MaskSoftnessX: 0
|
|
74
|
-
- _MaskSoftnessY: 0
|
|
75
|
-
- _Metallic: 0
|
|
76
|
-
- _Mode: 0
|
|
77
|
-
- _OcclusionStrength: 1
|
|
78
|
-
- _Parallax: 0.02
|
|
79
|
-
- _SmoothnessTextureChannel: 0
|
|
80
|
-
- _SpecularHighlights: 1
|
|
81
|
-
- _SrcBlend: 1
|
|
82
|
-
- _Stencil: 0
|
|
83
|
-
- _StencilComp: 8
|
|
84
|
-
- _StencilOp: 0
|
|
85
|
-
- _StencilReadMask: 255
|
|
86
|
-
- _StencilWriteMask: 255
|
|
87
|
-
- _UVSec: 0
|
|
88
|
-
- _UseUIAlphaClip: 0
|
|
89
|
-
- _VertexOffsetX: 0
|
|
90
|
-
- _VertexOffsetY: 0
|
|
91
|
-
- _ZWrite: 1
|
|
92
|
-
m_Colors:
|
|
93
|
-
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
|
94
|
-
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
|
95
|
-
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
|
96
|
-
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
|
97
|
-
m_BuildTextureStacks: []
|
package/link.xml
DELETED