Weaver Helpers: remove unused AddSearchDirectoryHelper

This commit is contained in:
vis2k 2020-03-09 16:23:51 +01:00
parent a26a0a39e2
commit 5801051a29

View File

@ -10,26 +10,6 @@ class Helpers
{
// This code is taken from SerializationWeaver
class AddSearchDirectoryHelper
{
delegate void AddSearchDirectoryDelegate(string directory);
readonly AddSearchDirectoryDelegate _addSearchDirectory;
public AddSearchDirectoryHelper(IAssemblyResolver assemblyResolver)
{
// reflection is used because IAssemblyResolver doesn't implement AddSearchDirectory but both DefaultAssemblyResolver and NuGetAssemblyResolver do
MethodInfo addSearchDirectory = assemblyResolver.GetType().GetMethod("AddSearchDirectory", BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(string) }, null);
if (addSearchDirectory == null)
throw new Exception("Assembly resolver doesn't implement AddSearchDirectory method.");
_addSearchDirectory = (AddSearchDirectoryDelegate)Delegate.CreateDelegate(typeof(AddSearchDirectoryDelegate), assemblyResolver, addSearchDirectory);
}
public void AddSearchDirectory(string directory)
{
_addSearchDirectory(directory);
}
}
public static string UnityEngineDLLDirectoryName()
{
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);