Browse Source

Merge pull request #1 from andruzzzhka/master

Copying plugins to .cache on launch
refactor
artman41 6 years ago
committed by GitHub
parent
commit
89507912ec
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
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