diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/UI/ARTrack/UIWindTraceLibrary.cs b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/UI/ARTrack/UIWindTraceLibrary.cs index 8cdff773..71cd8fe4 100644 --- a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/UI/ARTrack/UIWindTraceLibrary.cs +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/UI/ARTrack/UIWindTraceLibrary.cs @@ -45,6 +45,8 @@ namespace GameLogic private async UniTaskVoid OnClicktraceSaveLocalImageBtn() { + Log.Info(m_trackScrollerView.GetCurrentModel().m_data._key); + MobileGalleryPermissionUtility.SaveImageToGallery(m_trackScrollerView.GetCurrentModel().m_data._key,m_trackScrollerView.GetCurrentModel().m_data._texture); await UniTask.Yield(); } diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Image/ImageUtility.cs b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Image/ImageUtility.cs index 0c9e5dc3..a4f378cc 100644 --- a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Image/ImageUtility.cs +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Image/ImageUtility.cs @@ -1,6 +1,8 @@ using System; +using System.IO; using System.Threading; using Cysharp.Threading.Tasks; +using Fantasy; using UnityEngine; using UnityEngine.Networking; @@ -8,7 +10,7 @@ namespace GameLogic { public static class ImageUtility { - public static async UniTask UnityWebDownloadTexture2D(string url,CancellationToken token) + public static async UniTask UnityWebDownloadTexture2D(string url, CancellationToken token) { UnityWebRequest request = UnityWebRequestTexture.GetTexture(url); var operation = await request.SendWebRequest().ToUniTask(cancellationToken: token); @@ -17,8 +19,30 @@ namespace GameLogic Debug.LogWarning($"Error downloading image: {operation.error}"); return null; } + Texture2D tex2D = DownloadHandlerTexture.GetContent(request); + tex2D.name = GetImageNameFromUrl(url); return tex2D; } + + public static string GetImageNameFromUrl(string url) + { + try + { + // 移除可能存在的查询参数(?后面的部分) + int queryIndex = url.IndexOf('?'); + if (queryIndex != -1) + url = url.Substring(0, queryIndex); + + // 获取URL中的文件名部分 + string fileName = Path.GetFileName(url); + return fileName; + } + catch (Exception ex) + { + Debug.LogError($"从URL获取图片名称时出错: {ex.Message}"); + return string.Empty; + } + } } } \ No newline at end of file diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile.meta b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile.meta new file mode 100644 index 00000000..f0b7195c --- /dev/null +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dcd66b7d2eca1114a9910693b0a7b699 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile/MobileGalleryPermissionUtility.cs b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile/MobileGalleryPermissionUtility.cs new file mode 100644 index 00000000..ac2f8b03 --- /dev/null +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile/MobileGalleryPermissionUtility.cs @@ -0,0 +1,50 @@ +using System; +using TEngine; +using UnityEngine; +using VoxelBusters.CoreLibrary; +using VoxelBusters.EssentialKit; + +namespace GameLogic +{ + + /// + /// 移动端相册权限工具类 + /// + public static class MobileGalleryPermissionUtility + { + + + + /// + /// 保存图片到相册 + /// + public static void SaveImageToGallery(string fileName,Texture2D imgTex2D) + { + MediaContentSaveOptions saveOptions = new MediaContentSaveOptions(directoryName: "EintooAR", fileName: $"{fileName}"); + MediaServices.SaveMediaContent(imgTex2D.EncodeToPNG(), MimeType.kPNGImage, saveOptions, + (bool result, Error error) => + { + if (error == null) + { + SHowDialog($"图片保存成功/EintooAR/{imgTex2D.name}"); + } + else + { + SHowDialog($"图片保存失败/EintooAR/{imgTex2D.name}"); + } + }); + } + + private static void SHowDialog(string message) + { + AlertDialog dialog = AlertDialog.CreateInstance(); + dialog.Message = message; + + dialog.Show(); + GameModule.Timer.AddTimer((te)=> + { + dialog.Dismiss(); + },1f); + } + } +} diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile/MobileGalleryPermissionUtility.cs.meta b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile/MobileGalleryPermissionUtility.cs.meta new file mode 100644 index 00000000..4b761b1e --- /dev/null +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/AR Brochure/Utility/New/Mobile/MobileGalleryPermissionUtility.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4b26421fec2e3504f824940d1b9aecf1 \ No newline at end of file diff --git a/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef b/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef index 443db87e..7270e257 100644 --- a/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef +++ b/EintooAR/Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef @@ -32,7 +32,10 @@ "GUID:66c2eb417c67ad849907d0769db96dbf", "GUID:2289059ddf1745b4d80a0f184af99d6b", "GUID:448b0b55421917e4784a8f2f7449081f", - "GUID:bfb3a80268dac420ab25cd26e09e4475" + "GUID:bfb3a80268dac420ab25cd26e09e4475", + "GUID:46ee17e5fcc7f436f9df354a1efda6a4", + "GUID:77cdc4b9a869f4caa8b2e41e3b794af0", + "GUID:f712e8ae9bab041c2a043390d1a751a1" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/EintooAR/Assets/Plugins/Android/gradleTemplate.properties b/EintooAR/Assets/Plugins/Android/gradleTemplate.properties index cda43c03..d67da298 100644 --- a/EintooAR/Assets/Plugins/Android/gradleTemplate.properties +++ b/EintooAR/Assets/Plugins/Android/gradleTemplate.properties @@ -1,6 +1,10 @@ org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M org.gradle.parallel=true unityStreamingAssets=**STREAMING_ASSETS** +# Android Resolver Properties Start +android.useAndroidX=true +android.enableJetifier=true +# Android Resolver Properties End **ADDITIONAL_PROPERTIES** android.overridePathCheck=true android.useAndroidX=true diff --git a/EintooAR/Assets/Plugins/Android/mainTemplate.gradle b/EintooAR/Assets/Plugins/Android/mainTemplate.gradle index d57b642b..42285ca3 100644 --- a/EintooAR/Assets/Plugins/Android/mainTemplate.gradle +++ b/EintooAR/Assets/Plugins/Android/mainTemplate.gradle @@ -5,8 +5,32 @@ apply from: '../shared/keepUnitySymbols.gradle' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.2.0' +// Android Resolver Dependencies Start + implementation 'androidx.activity:activity:1.6.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:19 + implementation 'androidx.appcompat:appcompat:1.5.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:28 + implementation 'androidx.appcompat:appcompat-resources:1.5.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:30 + implementation 'androidx.core:core:1.7.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:25 + implementation 'androidx.exifinterface:exifinterface:1.3.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:17 + implementation 'com.android.billingclient:billing:7.1.1+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:9 + implementation 'com.google.android.gms:play-services-games-v2:20.0.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:12 + implementation 'com.google.android.play:app-update:2.1.0' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:6 + implementation 'com.google.android.play:review:2.0.1+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:22 + implementation 'com.google.firebase:firebase-messaging:23.1.1+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:15 +// Android Resolver Dependencies End **DEPS**} +// Android Resolver Exclusions Start +android { + packagingOptions { + exclude ('/lib/armeabi/*' + '*') + exclude ('/lib/armeabi-v7a/*' + '*') + exclude ('/lib/mips/*' + '*') + exclude ('/lib/mips64/*' + '*') + exclude ('/lib/x86/*' + '*') + exclude ('/lib/x86_64/*' + '*') + } +} +// Android Resolver Exclusions End android { namespace "com.unity3d.player" ndkPath "**NDKPATH**" diff --git a/EintooAR/Assets/Plugins/Android/settingsTemplate.gradle b/EintooAR/Assets/Plugins/Android/settingsTemplate.gradle new file mode 100644 index 00000000..0cc1dea8 --- /dev/null +++ b/EintooAR/Assets/Plugins/Android/settingsTemplate.gradle @@ -0,0 +1,27 @@ +pluginManagement { + repositories { + **ARTIFACTORYREPOSITORY** + gradlePluginPortal() + google() + mavenCentral() + } +} + +include ':launcher', ':unityLibrary' +**INCLUDES** + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) + repositories { + **ARTIFACTORYREPOSITORY** + google() + mavenCentral() +// Android Resolver Repos Start + def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") + mavenLocal() +// Android Resolver Repos End + flatDir { + dirs "${project(':unityLibrary').projectDir}/libs" + } + } +} diff --git a/EintooAR/Assets/Plugins/Android/settingsTemplate.gradle.meta b/EintooAR/Assets/Plugins/Android/settingsTemplate.gradle.meta new file mode 100644 index 00000000..936ad65b --- /dev/null +++ b/EintooAR/Assets/Plugins/Android/settingsTemplate.gradle.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ba42dad9f52e9374f9f332e777d31668 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/EintooAR/Assets/Resources/EssentialKitSettings.asset b/EintooAR/Assets/Resources/EssentialKitSettings.asset index bac6896f..d57fbed0 100644 --- a/EintooAR/Assets/Resources/EssentialKitSettings.asset +++ b/EintooAR/Assets/Resources/EssentialKitSettings.asset @@ -15,42 +15,49 @@ MonoBehaviour: m_applicationSettings: m_logLevel: 3 m_appStoreIds: - m_ios: + m_ios: 17380953476 m_tvos: - m_android: + m_android: com.Eintoo.EintooAR m_usagePermissionSettings: m_addressBookUsagePermission: - m_description: $productName uses contacts. + m_description: "This permission allows the app to access your contacts to + help you easily find and interact with your friends. (\u6B64\u6743\u9650\u5141\u8BB8\u5E94\u7528\u8BBF\u95EE\u60A8\u7684\u901A\u8BAF\u5F55\uFF0C\u4EE5\u4FBF\u5E2E\u52A9\u60A8\u8F7B\u677E\u627E\u5230\u670B\u53CB\u5E76\u4E0E\u4ED6\u4EEC\u4E92\u52A8\u3002)" m_descriptionOverrides: m_ios: m_tvos: m_android: m_cameraUsagePermission: - m_description: $productName uses camera. + m_description: "This permission allows the app to use your device's camera + to take photos or videos. (\u6B64\u6743\u9650\u5141\u8BB8\u5E94\u7528\u4F7F\u7528\u60A8\u7684\u8BBE\u5907\u76F8\u673A\u62CD\u6444\u7167\u7247\u6216\u89C6\u9891\u3002)" m_descriptionOverrides: m_ios: m_tvos: m_android: m_galleryUsagePermission: - m_description: $productName uses gallery. + m_description: This permission allows the app to access your gallery to select + and upload photos or videos. m_descriptionOverrides: m_ios: m_tvos: m_android: m_galleryWritePermission: - m_description: $productName wants to write to gallery. + m_description: "This permission allows the app to save photos or videos to + your gallery. (\u6B64\u6743\u9650\u5141\u8BB8\u5E94\u7528\u5C06\u7167\u7247\u6216\u89C6\u9891\u4FDD\u5B58\u5230\u60A8\u7684\u56FE\u5E93\u4E2D\u3002)" m_descriptionOverrides: m_ios: m_tvos: m_android: m_locationWhenInUsePermission: - m_description: $productName would like to user your location. + m_description: "This permission allows the app to access your location while + you are using the app to provide location-based services such as maps or + local content. (\u6B64\u6743\u9650\u5141\u8BB8\u5E94\u7528\u5728\u4F7F\u7528\u8FC7\u7A0B\u4E2D\u8BBF\u95EE\u60A8\u7684\u4F4D\u7F6E\uFF0C\u4EE5\u4FBF\u63D0\u4F9B\u57FA\u4E8E\u4F4D\u7F6E\u7684\u670D\u52A1\uFF0C\u5982\u5730\u56FE\u6216\u672C\u5730\u5185\u5BB9\u3002)" m_descriptionOverrides: m_ios: m_tvos: m_android: m_accessFriendsPermission: - m_description: $productName wants to access friends. + m_description: "This permission allows the app to access your friends' information + to enable social interactions and content sharing. (\u6B64\u6743\u9650\u5141\u8BB8\u5E94\u7528\u8BBF\u95EE\u60A8\u7684\u597D\u53CB\u4FE1\u606F\uFF0C\u4EE5\u4FBF\u5B9E\u73B0\u793E\u4EA4\u4E92\u52A8\u548C\u5185\u5BB9\u5171\u4EAB\u3002)" m_descriptionOverrides: m_ios: m_tvos: diff --git a/EintooAR/ProjectSettings/AndroidResolverDependencies.xml b/EintooAR/ProjectSettings/AndroidResolverDependencies.xml new file mode 100644 index 00000000..d0a4d929 --- /dev/null +++ b/EintooAR/ProjectSettings/AndroidResolverDependencies.xml @@ -0,0 +1,32 @@ + + + androidx.activity:activity:1.6.0+ + androidx.appcompat:appcompat:1.5.0+ + androidx.appcompat:appcompat-resources:1.5.0+ + androidx.core:core:1.7.0+ + androidx.exifinterface:exifinterface:1.3.0+ + com.android.billingclient:billing:7.1.1+ + com.google.android.gms:play-services-games-v2:20.0.0+ + com.google.android.play:app-update:2.1.0 + com.google.android.play:review:2.0.1+ + com.google.firebase:firebase-messaging:23.1.1+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EintooAR/ProjectSettings/GvhProjectSettings.xml b/EintooAR/ProjectSettings/GvhProjectSettings.xml index cd6fcb21..58bfcdbe 100644 --- a/EintooAR/ProjectSettings/GvhProjectSettings.xml +++ b/EintooAR/ProjectSettings/GvhProjectSettings.xml @@ -3,4 +3,6 @@ + + \ No newline at end of file diff --git a/EintooAR/ProjectSettings/ProjectSettings.asset b/EintooAR/ProjectSettings/ProjectSettings.asset index 48ef352e..2f1d0644 100644 --- a/EintooAR/ProjectSettings/ProjectSettings.asset +++ b/EintooAR/ProjectSettings/ProjectSettings.asset @@ -140,7 +140,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 1.05 + bundleVersion: 0.1.5 preloadedAssets: - {fileID: -944628639613478452, guid: c271117232a153d46826a63d58f2ad40, type: 3} metroInputSource: 0 @@ -783,7 +783,7 @@ PlayerSettings: webGLCloseOnQuit: 0 webWasm2023: 0 scriptingDefineSymbols: - Android: ENABLE_LOG;TextMeshPro;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;SLATE;ES3_TMPRO;ES3_UGUI;ATMOSPHERIC_HEIGHT_FOG;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2;NODECANVAS;ENABLE_HYBRIDCLR;ENABLE_VOXELBUSTERS_ESSENTIAL_KIT + Android: ENABLE_LOG;TextMeshPro;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;SLATE;ES3_TMPRO;ES3_UGUI;ATMOSPHERIC_HEIGHT_FOG;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2;NODECANVAS;ENABLE_HYBRIDCLR;ENABLE_VOXELBUSTERS_ESSENTIAL_KIT;ODIN_VALIDATOR_3_2;ODIN_VALIDATOR_3_3;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3 EmbeddedLinux: TextMeshPro;ES3_TMPRO;ES3_UGUI;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2 GameCoreScarlett: DOTWEEN GameCoreXboxOne: TextMeshPro;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2