2025-10-23 12:48:45 +08:00

27 lines
690 B
C#

using System.Collections.Generic;
namespace UnityFileApi
{
public static class DependencyTool
{
static DependencyTool()
{
UnityFileSystem.Init();
}
public static List<string> GetDependencies(string path)
{
List<string> dependencies = new List<string>();
// Try as SerializedFile
using (var serializedFile = UnityFileSystem.OpenSerializedFile(path))
{
foreach (var extRef in serializedFile.ExternalReferences)
{
dependencies.Add(extRef.Guid);
}
}
return dependencies;
}
}
}