Browse Source

Merge pull request #1 from andruzzzhka/master

Copying plugins to .cache on launch
pull/46/head
artman41 6 years ago
committed by GitHub
parent
commit
3aad72343f
2 changed files with 20 additions and 4 deletions
  1. +19
    -4
      IllusionInjector/PluginManager.cs
  2. +1
    -0
      IllusionPlugin/IllusionPlugin.csproj

+ 19
- 4
IllusionInjector/PluginManager.cs View File

@ -44,13 +44,28 @@ namespace IllusionInjector
_Plugins = new List<IPlugin>();
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");
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
debugLogger.Log($"Running on Unity {UnityEngine.Application.unityVersion}");


+ 1
- 0
IllusionPlugin/IllusionPlugin.csproj View File

@ -44,6 +44,7 @@
<Compile Include="IEnhancedPlugin.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="IPlugin.cs" />
<Compile Include="IPluginNew.cs" />
<Compile Include="Logger.cs" />
<Compile Include="ModPrefs.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />


Loading…
Cancel
Save