2025-04-05 19:02:50 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Obfuz
|
|
|
|
|
{
|
|
|
|
|
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))
|
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
//Debug.Log($"resolve {assemblyName} at {assPath}");
|
2025-04-05 19:02:50 +08:00
|
|
|
|
return assPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|