|
@ -44,13 +44,28 @@ namespace IllusionInjector |
|
|
_Plugins = new List<IPlugin>(); |
|
|
_Plugins = new List<IPlugin>(); |
|
|
|
|
|
|
|
|
if (!Directory.Exists(pluginDirectory)) return; |
|
|
if (!Directory.Exists(pluginDirectory)) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Directory.Exists(Path.Combine(pluginDirectory, ".cache"))) |
|
|
|
|
|
{ |
|
|
|
|
|
Directory.CreateDirectory(Path.Combine(pluginDirectory, ".cache")); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (string plugin in Directory.GetFiles(Path.Combine(pluginDirectory, ".cache"), "*")) |
|
|
|
|
|
{ |
|
|
|
|
|
File.Delete(plugin); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
String[] files = Directory.GetFiles(pluginDirectory, "*.dll"); |
|
|
String[] files = Directory.GetFiles(pluginDirectory, "*.dll"); |
|
|
foreach (var s in files) |
|
|
|
|
|
|
|
|
foreach (string s in files) |
|
|
{ |
|
|
{ |
|
|
_Plugins.AddRange(LoadPluginsFromFile(Path.Combine(pluginDirectory, s), exeName)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string pluginCopy = pluginDirectory + "\\.cache" + s.Substring(s.LastIndexOf('\\')); |
|
|
|
|
|
File.Copy(Path.Combine(pluginDirectory, s), pluginCopy); |
|
|
|
|
|
_Plugins.AddRange(LoadPluginsFromFile(pluginCopy, exeName)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DEBUG
|
|
|
// DEBUG
|
|
|
debugLogger.Log($"Running on Unity {UnityEngine.Application.unityVersion}"); |
|
|
debugLogger.Log($"Running on Unity {UnityEngine.Application.unityVersion}"); |
|
|