From f6d3bf65bc7d7630efdad46886f72953b933284e Mon Sep 17 00:00:00 2001 From: StarBeats <977663818@qq.com> Date: Thu, 23 Oct 2025 13:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=BC=E4=B9=8E=E7=B3=BB=E7=BB=9F=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=20utf-8=20=E7=BC=96=E7=A0=81=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5=E6=89=BE=E4=B8=8D=E5=88=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnityDependencyAnalyzer/Program.cs | 5 ++++- UnityFileDumper/DllWrapper.cs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/UnityDependencyAnalyzer/Program.cs b/UnityDependencyAnalyzer/Program.cs index b907095..4e1b113 100644 --- a/UnityDependencyAnalyzer/Program.cs +++ b/UnityDependencyAnalyzer/Program.cs @@ -1,5 +1,8 @@ -using AssetDependencyGraph; +using System.Runtime.InteropServices; using System.Text.Json; +using AssetDependencyGraph; +using UnityFileApi; +UnityFileSystem.Init(); switch (Environment.GetCommandLineArgs()[1]) { diff --git a/UnityFileDumper/DllWrapper.cs b/UnityFileDumper/DllWrapper.cs index 7707fca..4b29947 100644 --- a/UnityFileDumper/DllWrapper.cs +++ b/UnityFileDumper/DllWrapper.cs @@ -152,7 +152,7 @@ namespace UnityFileApi [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "UFS_MountArchive")] - public static extern ReturnCode MountArchive([MarshalAs(UnmanagedType.LPStr)] string path, [MarshalAs(UnmanagedType.LPStr)] string mountPoint, out UnityArchiveHandle handle); + public static extern ReturnCode MountArchive([MarshalAs(UnmanagedType.LPUTF8Str)] string path, [MarshalAs(UnmanagedType.LPUTF8Str)] string mountPoint, out UnityArchiveHandle handle); [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, @@ -172,14 +172,14 @@ namespace UnityFileApi [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "UFS_CreateArchive")] - public static extern ReturnCode CreateArchive([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] sourceFiles, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] aliases, bool[] isSerializedFile, int count, - [MarshalAs(UnmanagedType.LPStr)] string archiveFile, CompressionType compression, out int crc); + public static extern ReturnCode CreateArchive([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPUTF8Str)] string[] sourceFiles, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPUTF8Str)] string[] aliases, bool[] isSerializedFile, int count, + [MarshalAs(UnmanagedType.LPUTF8Str)] string archiveFile, CompressionType compression, out int crc); [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "UFS_OpenFile")] - public static extern ReturnCode OpenFile([MarshalAs(UnmanagedType.LPStr)] string path, out UnityFileHandle handle); + public static extern ReturnCode OpenFile([MarshalAs(UnmanagedType.LPUTF8Str)] string path, out UnityFileHandle handle); [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "UFS_ReadFile")] @@ -204,7 +204,7 @@ namespace UnityFileApi [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "UFS_OpenSerializedFile")] - public static extern ReturnCode OpenSerializedFile([MarshalAs(UnmanagedType.LPStr)] string path, out SerializedFileHandle handle); + public static extern ReturnCode OpenSerializedFile([MarshalAs(UnmanagedType.LPUTF8Str)] string path, out SerializedFileHandle handle); [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, @@ -239,8 +239,8 @@ namespace UnityFileApi [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl, EntryPoint = "UFS_GetRefTypeTypeTree")] - public static extern ReturnCode GetRefTypeTypeTree(SerializedFileHandle handle, [MarshalAs(UnmanagedType.LPStr)] string className, - [MarshalAs(UnmanagedType.LPStr)] string namespaceName, [MarshalAs(UnmanagedType.LPStr)] string assemblyName, out TypeTreeHandle typeTree); + public static extern ReturnCode GetRefTypeTypeTree(SerializedFileHandle handle, [MarshalAs(UnmanagedType.LPUTF8Str)] string className, + [MarshalAs(UnmanagedType.LPUTF8Str)] string namespaceName, [MarshalAs(UnmanagedType.LPUTF8Str)] string assemblyName, out TypeTreeHandle typeTree); [DllImport("UnityFileSystemApi", CallingConvention = CallingConvention.Cdecl,