com.taptap.sdk.core 4.3.0-aplha.5
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/Editor/BuildTargetUtils.cs +14 -0
- package/Editor/BuildTargetUtils.cs.meta +11 -0
- package/Editor/LinkXMLGenerator.cs +70 -0
- package/Editor/LinkXMLGenerator.cs.meta +11 -0
- package/Editor/Plist.cs +954 -0
- package/Editor/Plist.cs.meta +3 -0
- package/Editor/SDKLinkProcessBuild.cs +119 -0
- package/Editor/SDKLinkProcessBuild.cs.meta +11 -0
- package/Editor/TapFileHelper.cs +168 -0
- package/Editor/TapFileHelper.cs.meta +3 -0
- package/Editor/TapSDK.Core.Editor.asmdef +15 -0
- package/Editor/TapSDK.Core.Editor.asmdef.meta +7 -0
- package/Editor/TapSDKCoreCompile.cs +284 -0
- package/Editor/TapSDKCoreCompile.cs.meta +3 -0
- package/Editor/TapSDKCoreIOSProcessor.cs +74 -0
- package/Editor/TapSDKCoreIOSProcessor.cs.meta +3 -0
- package/Editor/UI/ScrollViewEditor.cs +267 -0
- package/Editor/UI/ScrollViewEditor.cs.meta +12 -0
- package/Editor/UI/ScrollViewExEditor.cs +34 -0
- package/Editor/UI/ScrollViewExEditor.cs.meta +12 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef +17 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef.meta +7 -0
- package/Editor/UI.meta +9 -0
- package/Editor.meta +8 -0
- package/Mobile/Editor/NativeDependencies.xml +22 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +8 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs +50 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Bridge.cs +84 -0
- package/Mobile/Runtime/Bridge.cs.meta +11 -0
- package/Mobile/Runtime/BridgeAndroid.cs +73 -0
- package/Mobile/Runtime/BridgeAndroid.cs.meta +11 -0
- package/Mobile/Runtime/BridgeCallback.cs +35 -0
- package/Mobile/Runtime/BridgeCallback.cs.meta +11 -0
- package/Mobile/Runtime/BridgeIOS.cs +113 -0
- package/Mobile/Runtime/BridgeIOS.cs.meta +11 -0
- package/Mobile/Runtime/Command.cs +119 -0
- package/Mobile/Runtime/Command.cs.meta +11 -0
- package/Mobile/Runtime/Constants.cs +9 -0
- package/Mobile/Runtime/Constants.cs.meta +11 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs +33 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs.meta +11 -0
- package/Mobile/Runtime/IBridge.cs +15 -0
- package/Mobile/Runtime/IBridge.cs.meta +11 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs +273 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Result.cs +37 -0
- package/Mobile/Runtime/Result.cs.meta +11 -0
- package/Mobile/Runtime/TapCoreMobile.cs +71 -0
- package/Mobile/Runtime/TapCoreMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapEventMobile.cs +265 -0
- package/Mobile/Runtime/TapEventMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef +18 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapUUID.cs +9 -0
- package/Mobile/Runtime/TapUUID.cs.meta +11 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf +0 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf.meta +22 -0
- package/Resources/Fonts/taptap-sdk.ttf +0 -0
- package/Resources/Fonts/taptap-sdk.ttf.meta +21 -0
- package/Resources/Fonts.meta +8 -0
- package/Resources/Loading.prefab +260 -0
- package/Resources/Loading.prefab.meta +7 -0
- package/Resources/TapCommonTip.prefab +194 -0
- package/Resources/TapCommonTip.prefab.meta +7 -0
- package/Resources/TapCommonToastBlack.prefab +528 -0
- package/Resources/TapCommonToastBlack.prefab.meta +7 -0
- package/Resources/TapCommonToastWhite.prefab +411 -0
- package/Resources/TapCommonToastWhite.prefab.meta +7 -0
- package/Resources/TapSDKCommonTapIcon-v2.png +0 -0
- package/Resources/TapSDKCommonTapIcon-v2.png.meta +128 -0
- package/Resources/TapSDKCommonTapIcon.png +0 -0
- package/Resources/TapSDKCommonTapIcon.png.meta +128 -0
- package/Resources/TapSDKCommonToastBg.png +0 -0
- package/Resources/TapSDKCommonToastBg.png.meta +128 -0
- package/Resources/TapSDKConstantUIRoot.prefab +100 -0
- package/Resources/TapSDKConstantUIRoot.prefab.meta +7 -0
- package/Resources/TapSDKUIRoot.prefab +100 -0
- package/Resources/TapSDKUIRoot.prefab.meta +7 -0
- package/Resources/TapTapBtn_White.png +0 -0
- package/Resources/TapTapBtn_White.png.meta +128 -0
- package/Resources/TapTapBtn_White_2.png +0 -0
- package/Resources/TapTapBtn_White_2.png.meta +128 -0
- package/Resources/ToastBackground.png +0 -0
- package/Resources/ToastBackground.png.meta +128 -0
- package/Resources/detail_bg.png +0 -0
- package/Resources/detail_bg.png.meta +92 -0
- package/Resources/success.png +0 -0
- package/Resources/success.png.meta +128 -0
- package/Resources/taptap-bg.png +0 -0
- package/Resources/taptap-bg.png.meta +140 -0
- package/Resources/taptap-close.png +0 -0
- package/Resources/taptap-close.png.meta +146 -0
- package/Resources/taptap-router-v2.png +0 -0
- package/Resources/taptap-router-v2.png.meta +128 -0
- package/Resources/taptap-router.png +0 -0
- package/Resources/taptap-router.png.meta +146 -0
- package/Resources/taptap-sdk-refresh 1.png +0 -0
- package/Resources/taptap-sdk-refresh 1.png.meta +128 -0
- package/Resources/taptap-toast-error.png +0 -0
- package/Resources/taptap-toast-error.png.meta +128 -0
- package/Resources/taptap-toast-info.png +0 -0
- package/Resources/taptap-toast-info.png.meta +128 -0
- package/Resources/taptap-toast-success.png +0 -0
- package/Resources/taptap-toast-success.png.meta +128 -0
- package/Resources/taptap-toast-warning.png +0 -0
- package/Resources/taptap-toast-warning.png.meta +128 -0
- package/Resources.meta +8 -0
- package/Runtime/Internal/Http/TapHttpClient.cs +176 -0
- package/Runtime/Internal/Http/TapHttpClient.cs.meta +11 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs +83 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs.meta +11 -0
- package/Runtime/Internal/Http.meta +8 -0
- package/Runtime/Internal/Init/IInitTask.cs +18 -0
- package/Runtime/Internal/Init/IInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs +40 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs.meta +11 -0
- package/Runtime/Internal/Json.meta +8 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs +12 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs +37 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs +46 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta +11 -0
- package/Runtime/Internal/Platform.meta +8 -0
- package/Runtime/Internal/UI/Base/Const.cs +27 -0
- package/Runtime/Internal/UI/Base/Const.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs +240 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs +29 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs +102 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/Singleton.cs +29 -0
- package/Runtime/Internal/UI/Base/Singleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs +45 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs +95 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs +79 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/UIManager.cs +724 -0
- package/Runtime/Internal/UI/Base/UIManager.cs.meta +11 -0
- package/Runtime/Internal/UI/Base.meta +8 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs +385 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/BasePanel.meta +8 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs +18 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta +11 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs +7 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta +11 -0
- package/Runtime/Internal/UI/Params.meta +8 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs +76 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs +828 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs +245 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx.meta +8 -0
- package/Runtime/Internal/UI.meta +8 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs +29 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/ImageUtils.cs +147 -0
- package/Runtime/Internal/Utils/ImageUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/TapLoom.cs +155 -0
- package/Runtime/Internal/Utils/TapLoom.cs.meta +11 -0
- package/Runtime/Internal/Utils/UrlUtils.cs +34 -0
- package/Runtime/Internal/Utils/UrlUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils.meta +8 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/Public/DataStorage.cs +141 -0
- package/Runtime/Public/DataStorage.cs.meta +11 -0
- package/Runtime/Public/ITapPropertiesProxy.cs +6 -0
- package/Runtime/Public/ITapPropertiesProxy.cs.meta +11 -0
- package/Runtime/Public/Json.cs +636 -0
- package/Runtime/Public/Json.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogLevel.cs +7 -0
- package/Runtime/Public/Log/TapLogLevel.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogger.cs +48 -0
- package/Runtime/Public/Log/TapLogger.cs.meta +11 -0
- package/Runtime/Public/Log.meta +8 -0
- package/Runtime/Public/Platform.cs +27 -0
- package/Runtime/Public/Platform.cs.meta +11 -0
- package/Runtime/Public/RegionType.cs +8 -0
- package/Runtime/Public/RegionType.cs.meta +11 -0
- package/Runtime/Public/SafeDictionary.cs +27 -0
- package/Runtime/Public/SafeDictionary.cs.meta +11 -0
- package/Runtime/Public/TapError.cs +62 -0
- package/Runtime/Public/TapError.cs.meta +11 -0
- package/Runtime/Public/TapErrorCode.cs +44 -0
- package/Runtime/Public/TapErrorCode.cs.meta +11 -0
- package/Runtime/Public/TapException.cs +24 -0
- package/Runtime/Public/TapException.cs.meta +11 -0
- package/Runtime/Public/TapLanguage.cs +21 -0
- package/Runtime/Public/TapLanguage.cs.meta +11 -0
- package/Runtime/Public/TapLocalizeManager.cs +128 -0
- package/Runtime/Public/TapLocalizeManager.cs.meta +11 -0
- package/Runtime/Public/TapTapEvent.cs +93 -0
- package/Runtime/Public/TapTapEvent.cs.meta +11 -0
- package/Runtime/Public/TapTapSDK.cs +96 -0
- package/Runtime/Public/TapTapSDK.cs.meta +11 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs +104 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef +3 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs +20 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist +46 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo +0 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources +115 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle.meta +33 -0
- package/Standalone/Plugins/macOS.meta +8 -0
- package/Standalone/Plugins.meta +8 -0
- package/Standalone/Runtime/Internal/Constants.cs +37 -0
- package/Standalone/Runtime/Internal/Constants.cs.meta +11 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs +152 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs.meta +11 -0
- package/Standalone/Runtime/Internal/EventSender.cs +239 -0
- package/Standalone/Runtime/Internal/EventSender.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs +211 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs +48 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs +30 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http.meta +8 -0
- package/Standalone/Runtime/Internal/Identity.cs +43 -0
- package/Standalone/Runtime/Internal/Identity.cs.meta +11 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs +53 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Prefs.cs +85 -0
- package/Standalone/Runtime/Internal/Prefs.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Tracker.cs +318 -0
- package/Standalone/Runtime/Internal/Tracker.cs.meta +11 -0
- package/Standalone/Runtime/Internal/User.cs +51 -0
- package/Standalone/Runtime/Internal/User.cs.meta +11 -0
- package/Standalone/Runtime/Internal.meta +8 -0
- package/Standalone/Runtime/Public/EventManager.cs +41 -0
- package/Standalone/Runtime/Public/EventManager.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs +197 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs +281 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public.meta +8 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +21 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone.meta +8 -0
- package/package.json +8 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.Core.Internal {
|
|
4
|
+
public interface ITapEventPlatform {
|
|
5
|
+
void SetUserID(string userID);
|
|
6
|
+
|
|
7
|
+
void SetUserID(string userID, string properties);
|
|
8
|
+
void ClearUser();
|
|
9
|
+
|
|
10
|
+
string GetDeviceId();
|
|
11
|
+
|
|
12
|
+
void LogEvent(string name, string properties);
|
|
13
|
+
|
|
14
|
+
void DeviceInitialize(string properties);
|
|
15
|
+
|
|
16
|
+
void DeviceUpdate(string properties);
|
|
17
|
+
void DeviceAdd(string properties);
|
|
18
|
+
|
|
19
|
+
void UserInitialize(string properties);
|
|
20
|
+
|
|
21
|
+
void UserUpdate(string properties);
|
|
22
|
+
|
|
23
|
+
void UserAdd(string properties);
|
|
24
|
+
|
|
25
|
+
void AddCommonProperty(string key, string value);
|
|
26
|
+
|
|
27
|
+
void AddCommon(string properties);
|
|
28
|
+
|
|
29
|
+
void ClearCommonProperty(string key);
|
|
30
|
+
void ClearCommonProperties(string[] keys);
|
|
31
|
+
|
|
32
|
+
void ClearAllCommonProperties();
|
|
33
|
+
void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties);
|
|
34
|
+
|
|
35
|
+
void RegisterDynamicProperties(Func<string> callback);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Linq;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TapSDK.Core.Internal {
|
|
6
|
+
public static class PlatformTypeUtils {
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// 创建平台接口实现类对象
|
|
9
|
+
/// </summary>
|
|
10
|
+
/// <param name="interfaceType"></param>
|
|
11
|
+
/// <param name="startWith"></param>
|
|
12
|
+
/// <returns></returns>
|
|
13
|
+
public static object CreatePlatformImplementationObject(Type interfaceType, string startWith) {
|
|
14
|
+
Debug.Log($"Searching for types in assemblies starting with: {startWith} that implement: {interfaceType}");
|
|
15
|
+
|
|
16
|
+
// 获取所有符合条件的程序集
|
|
17
|
+
var assemblies = AppDomain.CurrentDomain.GetAssemblies()
|
|
18
|
+
.Where(assembly => assembly.GetName().FullName.StartsWith(startWith));
|
|
19
|
+
|
|
20
|
+
foreach (var assembly in assemblies) {
|
|
21
|
+
Debug.Log($"Found assembly: {assembly.GetName().FullName}");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 获取符合条件的类型
|
|
25
|
+
Type platformSupportType = assemblies
|
|
26
|
+
.SelectMany(assembly => assembly.GetTypes())
|
|
27
|
+
.SingleOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
|
|
28
|
+
|
|
29
|
+
if (platformSupportType != null) {
|
|
30
|
+
Debug.Log($"Found type: {platformSupportType.FullName}, creating instance...");
|
|
31
|
+
try
|
|
32
|
+
{
|
|
33
|
+
return Activator.CreateInstance(platformSupportType);
|
|
34
|
+
}
|
|
35
|
+
catch (Exception ex)
|
|
36
|
+
{
|
|
37
|
+
Debug.LogError($"Failed to create instance of {platformSupportType.FullName}: {ex}");
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
Debug.LogError($"No type found that implements {interfaceType} in assemblies starting with {startWith}");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
namespace TapSDK.UI
|
|
3
|
+
{
|
|
4
|
+
public enum EOpenMode
|
|
5
|
+
{
|
|
6
|
+
Sync,
|
|
7
|
+
|
|
8
|
+
Async,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[Flags]
|
|
12
|
+
public enum EAnimationMode
|
|
13
|
+
{
|
|
14
|
+
None = 0,
|
|
15
|
+
|
|
16
|
+
Alpha = 1 << 0,
|
|
17
|
+
|
|
18
|
+
Scale = 1 << 1,
|
|
19
|
+
|
|
20
|
+
RightSlideIn = 1 << 2,
|
|
21
|
+
|
|
22
|
+
UpSlideIn = 1 << 3,
|
|
23
|
+
ToastSlideIn = 1 << 4,
|
|
24
|
+
|
|
25
|
+
AlphaAndScale = Alpha | Scale,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Text;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.EventSystems;
|
|
6
|
+
using UnityEngine.Serialization;
|
|
7
|
+
using UnityEngine.UI;
|
|
8
|
+
|
|
9
|
+
namespace TapTap.UI
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// 修复UnityUGui中Canvas画布在Windows平台宽高比过长(横屏拉很长)导致UI的最右边一部分无法被点击的Bug,现发现与2021.3.x版本
|
|
13
|
+
/// </summary>
|
|
14
|
+
public class GraphicRaycasterBugFixed : GraphicRaycaster
|
|
15
|
+
{
|
|
16
|
+
[NonSerialized] private List<Graphic> m_RaycastResults = new List<Graphic>();
|
|
17
|
+
private Canvas _Canvas;
|
|
18
|
+
private Canvas canvasBugFixed
|
|
19
|
+
{
|
|
20
|
+
get
|
|
21
|
+
{
|
|
22
|
+
if (_Canvas != null)
|
|
23
|
+
return _Canvas;
|
|
24
|
+
|
|
25
|
+
_Canvas = GetComponent<Canvas>();
|
|
26
|
+
return _Canvas;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/// <summary>
|
|
30
|
+
/// Perform the raycast against the list of graphics associated with the Canvas.
|
|
31
|
+
/// </summary>
|
|
32
|
+
/// <param name="eventData">Current event data</param>
|
|
33
|
+
/// <param name="resultAppendList">List of hit objects to append new results to.</param>
|
|
34
|
+
public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
|
|
35
|
+
{
|
|
36
|
+
if (canvasBugFixed == null)
|
|
37
|
+
return;
|
|
38
|
+
|
|
39
|
+
var canvasGraphics = GraphicRegistry.GetGraphicsForCanvas(canvasBugFixed);
|
|
40
|
+
if (canvasGraphics == null || canvasGraphics.Count == 0)
|
|
41
|
+
return;
|
|
42
|
+
|
|
43
|
+
int displayIndex;
|
|
44
|
+
var currentEventCamera = eventCamera; // Property can call Camera.main, so cache the reference
|
|
45
|
+
|
|
46
|
+
if (canvasBugFixed.renderMode == RenderMode.ScreenSpaceOverlay || currentEventCamera == null)
|
|
47
|
+
displayIndex = canvasBugFixed.targetDisplay;
|
|
48
|
+
else
|
|
49
|
+
displayIndex = currentEventCamera.targetDisplay;
|
|
50
|
+
|
|
51
|
+
//!! 不同之处
|
|
52
|
+
var eventPosition = Display.RelativeMouseAt(eventData.position);
|
|
53
|
+
//MultipleDisplayUtilities.RelativeMouseAtScaled(eventData.position);
|
|
54
|
+
if (eventPosition != Vector3.zero)
|
|
55
|
+
{
|
|
56
|
+
// We support multiple display and display identification based on event position.
|
|
57
|
+
|
|
58
|
+
int eventDisplayIndex = (int)eventPosition.z;
|
|
59
|
+
|
|
60
|
+
// Discard events that are not part of this display so the user does not interact with multiple displays at once.
|
|
61
|
+
if (eventDisplayIndex != displayIndex)
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
else
|
|
65
|
+
{
|
|
66
|
+
// The multiple display system is not supported on all platforms, when it is not supported the returned position
|
|
67
|
+
// will be all zeros so when the returned index is 0 we will default to the event data to be safe.
|
|
68
|
+
eventPosition = eventData.position;
|
|
69
|
+
|
|
70
|
+
// We dont really know in which display the event occured. We will process the event assuming it occured in our display.
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Convert to view space
|
|
74
|
+
Vector2 pos;
|
|
75
|
+
if (currentEventCamera == null)
|
|
76
|
+
{
|
|
77
|
+
// Multiple display support only when not the main display. For display 0 the reported
|
|
78
|
+
// resolution is always the desktops resolution since its part of the display API,
|
|
79
|
+
// so we use the standard none multiple display method. (case 741751)
|
|
80
|
+
float w = Screen.width;
|
|
81
|
+
float h = Screen.height;
|
|
82
|
+
if (displayIndex > 0 && displayIndex < Display.displays.Length)
|
|
83
|
+
{
|
|
84
|
+
w = Display.displays[displayIndex].systemWidth;
|
|
85
|
+
h = Display.displays[displayIndex].systemHeight;
|
|
86
|
+
}
|
|
87
|
+
pos = new Vector2(eventPosition.x / w, eventPosition.y / h);
|
|
88
|
+
}
|
|
89
|
+
else
|
|
90
|
+
pos = currentEventCamera.ScreenToViewportPoint(eventPosition);
|
|
91
|
+
|
|
92
|
+
// If it's outside the camera's viewport, do nothing
|
|
93
|
+
if (pos.x < 0f || pos.x > 1f || pos.y < 0f || pos.y > 1f)
|
|
94
|
+
return;
|
|
95
|
+
|
|
96
|
+
float hitDistance = float.MaxValue;
|
|
97
|
+
|
|
98
|
+
Ray ray = new Ray();
|
|
99
|
+
|
|
100
|
+
if (currentEventCamera != null)
|
|
101
|
+
ray = currentEventCamera.ScreenPointToRay(eventPosition);
|
|
102
|
+
|
|
103
|
+
if (canvasBugFixed.renderMode != RenderMode.ScreenSpaceOverlay && blockingObjects != BlockingObjects.None)
|
|
104
|
+
{
|
|
105
|
+
float distanceToClipPlane = 100.0f;
|
|
106
|
+
|
|
107
|
+
if (currentEventCamera != null)
|
|
108
|
+
{
|
|
109
|
+
float projectionDirection = ray.direction.z;
|
|
110
|
+
distanceToClipPlane = Mathf.Approximately(0.0f, projectionDirection)
|
|
111
|
+
? Mathf.Infinity
|
|
112
|
+
: Mathf.Abs((currentEventCamera.farClipPlane - currentEventCamera.nearClipPlane) / projectionDirection);
|
|
113
|
+
}
|
|
114
|
+
#if PACKAGE_PHYSICS
|
|
115
|
+
if (blockingObjects == BlockingObjects.ThreeD || blockingObjects == BlockingObjects.All)
|
|
116
|
+
{
|
|
117
|
+
if (ReflectionMethodsCache.Singleton.raycast3D != null)
|
|
118
|
+
{
|
|
119
|
+
var hits = ReflectionMethodsCache.Singleton.raycast3DAll(ray, distanceToClipPlane, (int)m_BlockingMask);
|
|
120
|
+
if (hits.Length > 0)
|
|
121
|
+
hitDistance = hits[0].distance;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
#endif
|
|
125
|
+
#if PACKAGE_PHYSICS2D
|
|
126
|
+
if (blockingObjects == BlockingObjects.TwoD || blockingObjects == BlockingObjects.All)
|
|
127
|
+
{
|
|
128
|
+
if (ReflectionMethodsCache.Singleton.raycast2D != null)
|
|
129
|
+
{
|
|
130
|
+
var hits = ReflectionMethodsCache.Singleton.getRayIntersectionAll(ray, distanceToClipPlane, (int)m_BlockingMask);
|
|
131
|
+
if (hits.Length > 0)
|
|
132
|
+
hitDistance = hits[0].distance;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
#endif
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
m_RaycastResults.Clear();
|
|
139
|
+
|
|
140
|
+
Raycast(canvasBugFixed, currentEventCamera, eventPosition, canvasGraphics, m_RaycastResults);
|
|
141
|
+
|
|
142
|
+
int totalCount = m_RaycastResults.Count;
|
|
143
|
+
for (var index = 0; index < totalCount; index++)
|
|
144
|
+
{
|
|
145
|
+
var go = m_RaycastResults[index].gameObject;
|
|
146
|
+
bool appendGraphic = true;
|
|
147
|
+
|
|
148
|
+
if (ignoreReversedGraphics)
|
|
149
|
+
{
|
|
150
|
+
if (currentEventCamera == null)
|
|
151
|
+
{
|
|
152
|
+
// If we dont have a camera we know that we should always be facing forward
|
|
153
|
+
var dir = go.transform.rotation * Vector3.forward;
|
|
154
|
+
appendGraphic = Vector3.Dot(Vector3.forward, dir) > 0;
|
|
155
|
+
}
|
|
156
|
+
else
|
|
157
|
+
{
|
|
158
|
+
// If we have a camera compare the direction against the cameras forward.
|
|
159
|
+
var cameraForward = currentEventCamera.transform.rotation * Vector3.forward * currentEventCamera.nearClipPlane;
|
|
160
|
+
// !!不同之处
|
|
161
|
+
appendGraphic = Vector3.Dot(go.transform.position - currentEventCamera.transform.position - cameraForward, go.transform.forward) >= 0;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (appendGraphic)
|
|
166
|
+
{
|
|
167
|
+
float distance = 0;
|
|
168
|
+
Transform trans = go.transform;
|
|
169
|
+
Vector3 transForward = trans.forward;
|
|
170
|
+
|
|
171
|
+
if (currentEventCamera == null || canvasBugFixed.renderMode == RenderMode.ScreenSpaceOverlay)
|
|
172
|
+
distance = 0;
|
|
173
|
+
else
|
|
174
|
+
{
|
|
175
|
+
// http://geomalgorithms.com/a06-_intersect-2.html
|
|
176
|
+
distance = (Vector3.Dot(transForward, trans.position - ray.origin) / Vector3.Dot(transForward, ray.direction));
|
|
177
|
+
|
|
178
|
+
// Check to see if the go is behind the camera.
|
|
179
|
+
if (distance < 0)
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (distance >= hitDistance)
|
|
184
|
+
continue;
|
|
185
|
+
|
|
186
|
+
var castResult = new RaycastResult
|
|
187
|
+
{
|
|
188
|
+
gameObject = go,
|
|
189
|
+
module = this,
|
|
190
|
+
distance = distance,
|
|
191
|
+
screenPosition = eventPosition,
|
|
192
|
+
displayIndex = displayIndex,
|
|
193
|
+
index = resultAppendList.Count,
|
|
194
|
+
depth = m_RaycastResults[index].depth,
|
|
195
|
+
sortingLayer = canvasBugFixed.sortingLayerID,
|
|
196
|
+
sortingOrder = canvasBugFixed.sortingOrder,
|
|
197
|
+
worldPosition = ray.origin + ray.direction * distance,
|
|
198
|
+
worldNormal = -transForward
|
|
199
|
+
};
|
|
200
|
+
resultAppendList.Add(castResult);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/// <summary>
|
|
205
|
+
/// Perform a raycast into the screen and collect all graphics underneath it.
|
|
206
|
+
/// </summary>
|
|
207
|
+
[NonSerialized] static readonly List<Graphic> s_SortedGraphics = new List<Graphic>();
|
|
208
|
+
private static void Raycast(Canvas canvas, Camera eventCamera, Vector2 pointerPosition, IList<Graphic> foundGraphics, List<Graphic> results)
|
|
209
|
+
{
|
|
210
|
+
// Necessary for the event system
|
|
211
|
+
int totalCount = foundGraphics.Count;
|
|
212
|
+
for (int i = 0; i < totalCount; ++i)
|
|
213
|
+
{
|
|
214
|
+
Graphic graphic = foundGraphics[i];
|
|
215
|
+
|
|
216
|
+
// -1 means it hasn't been processed by the canvas, which means it isn't actually drawn
|
|
217
|
+
if (!graphic.raycastTarget || graphic.canvasRenderer.cull || graphic.depth == -1)
|
|
218
|
+
continue;
|
|
219
|
+
|
|
220
|
+
if (!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, pointerPosition, eventCamera))
|
|
221
|
+
continue;
|
|
222
|
+
|
|
223
|
+
if (eventCamera != null && eventCamera.WorldToScreenPoint(graphic.rectTransform.position).z > eventCamera.farClipPlane)
|
|
224
|
+
continue;
|
|
225
|
+
|
|
226
|
+
if (graphic.Raycast(pointerPosition, eventCamera))
|
|
227
|
+
{
|
|
228
|
+
s_SortedGraphics.Add(graphic);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
s_SortedGraphics.Sort((g1, g2) => g2.depth.CompareTo(g1.depth));
|
|
233
|
+
totalCount = s_SortedGraphics.Count;
|
|
234
|
+
for (int i = 0; i < totalCount; ++i)
|
|
235
|
+
results.Add(s_SortedGraphics[i]);
|
|
236
|
+
|
|
237
|
+
s_SortedGraphics.Clear();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.UI
|
|
4
|
+
{
|
|
5
|
+
public class LoadingPanelController : BasePanelController
|
|
6
|
+
{
|
|
7
|
+
public Transform rotater;
|
|
8
|
+
|
|
9
|
+
public float speed = 10;
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// bind ugui components for every panel
|
|
12
|
+
/// </summary>
|
|
13
|
+
protected override void BindComponents()
|
|
14
|
+
{
|
|
15
|
+
rotater = transform.Find("Image");;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private void Update()
|
|
19
|
+
{
|
|
20
|
+
if (rotater != null)
|
|
21
|
+
{
|
|
22
|
+
var localEuler = rotater.localEulerAngles;
|
|
23
|
+
var z = rotater.localEulerAngles.z;
|
|
24
|
+
z += Time.deltaTime * speed;
|
|
25
|
+
rotater.localEulerAngles = new Vector3(localEuler.x, localEuler.y, z);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.UI
|
|
5
|
+
{
|
|
6
|
+
public class MonoSingleton<T> : MonoBehaviour where T : Component
|
|
7
|
+
{
|
|
8
|
+
private static T _instance;
|
|
9
|
+
|
|
10
|
+
public static T Instance
|
|
11
|
+
{
|
|
12
|
+
get
|
|
13
|
+
{
|
|
14
|
+
if (_instance == null && Application.isPlaying)
|
|
15
|
+
{
|
|
16
|
+
CreateInstance();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return _instance;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private static void CreateInstance()
|
|
24
|
+
{
|
|
25
|
+
Type theType = typeof(T);
|
|
26
|
+
|
|
27
|
+
_instance = (T)FindObjectOfType(theType);
|
|
28
|
+
|
|
29
|
+
if (_instance == null)
|
|
30
|
+
{
|
|
31
|
+
var go = new GameObject(typeof(T).Name);
|
|
32
|
+
_instance = go.AddComponent<T>();
|
|
33
|
+
|
|
34
|
+
GameObject rootObj = GameObject.Find("TapSDKSingletons");
|
|
35
|
+
if (rootObj == null)
|
|
36
|
+
{
|
|
37
|
+
rootObj = new GameObject("TapSDKSingletons");
|
|
38
|
+
DontDestroyOnLoad(rootObj);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
go.transform.SetParent(rootObj.transform);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public static void DestroyInstance()
|
|
46
|
+
{
|
|
47
|
+
if (_instance != null)
|
|
48
|
+
{
|
|
49
|
+
Destroy(_instance.gameObject);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public static bool HasInstance()
|
|
54
|
+
{
|
|
55
|
+
return _instance != null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
protected virtual void Awake()
|
|
59
|
+
{
|
|
60
|
+
if (_instance != null && _instance.gameObject != gameObject)
|
|
61
|
+
{
|
|
62
|
+
if (Application.isPlaying)
|
|
63
|
+
{
|
|
64
|
+
Destroy(gameObject);
|
|
65
|
+
}
|
|
66
|
+
else
|
|
67
|
+
{
|
|
68
|
+
DestroyImmediate(gameObject); // UNITY_EDITOR
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
else if (_instance == null)
|
|
74
|
+
{
|
|
75
|
+
_instance = GetComponent<T>();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
DontDestroyOnLoad(gameObject);
|
|
79
|
+
|
|
80
|
+
Init();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
protected virtual void OnDestroy()
|
|
84
|
+
{
|
|
85
|
+
Uninit();
|
|
86
|
+
|
|
87
|
+
if (_instance != null && _instance.gameObject == gameObject)
|
|
88
|
+
{
|
|
89
|
+
_instance = null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public virtual void Init()
|
|
94
|
+
{
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public virtual void Uninit()
|
|
98
|
+
{
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.UI
|
|
4
|
+
{
|
|
5
|
+
public class Singleton<T> where T : class
|
|
6
|
+
{
|
|
7
|
+
private static T _instance;
|
|
8
|
+
private static readonly object _lock = new object();
|
|
9
|
+
|
|
10
|
+
public static T Instance
|
|
11
|
+
{
|
|
12
|
+
get
|
|
13
|
+
{
|
|
14
|
+
if (_instance == null)
|
|
15
|
+
{
|
|
16
|
+
lock (_lock)
|
|
17
|
+
{
|
|
18
|
+
if (_instance == null)
|
|
19
|
+
{
|
|
20
|
+
_instance = (T)Activator.CreateInstance(typeof(T), true);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _instance;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
using UnityEngine.UI;
|
|
4
|
+
|
|
5
|
+
namespace TapSDK.UI
|
|
6
|
+
{
|
|
7
|
+
public class TipPanelOpenParam : AbstractOpenPanelParameter
|
|
8
|
+
{
|
|
9
|
+
public string text;
|
|
10
|
+
|
|
11
|
+
public Color textColor;
|
|
12
|
+
|
|
13
|
+
public TextAnchor textAnchor;
|
|
14
|
+
|
|
15
|
+
public TipPanelOpenParam(string text, Color textColor, TextAnchor textAnchor)
|
|
16
|
+
{
|
|
17
|
+
this.text = text;
|
|
18
|
+
this.textColor = textColor;
|
|
19
|
+
this.textAnchor = textAnchor;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
public class TipPanelController : BasePanelController
|
|
23
|
+
{
|
|
24
|
+
public Text text;
|
|
25
|
+
|
|
26
|
+
protected override void BindComponents()
|
|
27
|
+
{
|
|
28
|
+
base.BindComponents();
|
|
29
|
+
text = transform.Find("Text").GetComponent<Text>();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected override void OnLoadSuccess()
|
|
33
|
+
{
|
|
34
|
+
base.OnLoadSuccess();
|
|
35
|
+
TipPanelOpenParam param = this.openParam as TipPanelOpenParam;
|
|
36
|
+
if (param != null)
|
|
37
|
+
{
|
|
38
|
+
text.text = param.text;
|
|
39
|
+
text.color = param.textColor;
|
|
40
|
+
text.alignment = param.textAnchor;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
}
|