mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
29 lines
746 B
C#
29 lines
746 B
C#
using System.IO;
|
|
|
|
namespace Obfuz.Utils
|
|
{
|
|
public class PathAssemblyResolver : AssemblyResolverBase
|
|
{
|
|
private readonly string[] _searchPaths;
|
|
|
|
public PathAssemblyResolver(params string[] searchPaths)
|
|
{
|
|
_searchPaths = searchPaths;
|
|
}
|
|
|
|
public override string ResolveAssembly(string assemblyName)
|
|
{
|
|
foreach (var path in _searchPaths)
|
|
{
|
|
string assPath = Path.Combine(path, assemblyName + ".dll");
|
|
if (File.Exists(assPath))
|
|
{
|
|
//Debug.Log($"resolve {assemblyName} at {assPath}");
|
|
return assPath;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|