private void CopyNativePlugins()
{
string buildTargetName = BuildPipeline.GetBuildTargetName(this.m_PostProcessArgs.target);
IPluginImporterExtension extension = new DesktopPluginImporterExtension();
string stagingAreaPluginsFolder = this.StagingAreaPluginsFolder;
string path = Path.Combine(stagingAreaPluginsFolder, "x86");
string str4 = Path.Combine(stagingAreaPluginsFolder, "x86_64");
bool flag = false;
bool flag2 = false;
bool flag3 = false;
foreach (PluginImporter importer in PluginImporter.GetImporters(this.m_PostProcessArgs.target))
{
BuildTarget platform = this.m_PostProcessArgs.target;
if (importer.isNativePlugin)
{
if (string.IsNullOrEmpty(importer.assetPath))
{
Debug.LogWarning("Got empty plugin importer path for " + this.m_PostProcessArgs.target.ToString());
continue;
}
if (!flag)
{
Directory.CreateDirectory(stagingAreaPluginsFolder);
flag = true;
}
bool flag4 = Directory.Exists(importer.assetPath);
switch (importer.GetPlatformData(platform, "CPU"))
{
case "x86":
switch (platform)
{
case BuildTarget.StandaloneOSXIntel64:
case BuildTarget.StandaloneWindows64:
case BuildTarget.StandaloneLinux64:
{
continue;
}
}
if (!flag2)
{
Directory.CreateDirectory(path);
flag2 = true;
}
break;
case "x86_64":
if ((((platform != BuildTarget.StandaloneOSXIntel64) && (platform != BuildTarget.StandaloneOSXUniversal)) && ((platform != BuildTarget.StandaloneWindows64) && (platform != BuildTarget.StandaloneLinux64))) && (platform != BuildTarget.StandaloneLinuxUniversal))
{
continue;
}
if (!flag3)
{
Directory.CreateDirectory(str4);
flag3 = true;
}
break;
case "None":
{
continue;
}
}
string str6 = extension.CalculateFinalPluginPath(buildTargetName, importer);
if (!string.IsNullOrEmpty(str6))
{
string target = Path.Combine(stagingAreaPluginsFolder, str6);
if (flag4)
{
FileUtil.CopyDirectoryRecursive(importer.assetPath, target);
}
else
{
FileUtil.UnityFileCopy(importer.assetPath, target);
}
}
}
}
foreach (PluginDesc desc in PluginImporter.GetExtensionPlugins(this.m_PostProcessArgs.target))
{
if (!flag)
{
Directory.CreateDirectory(stagingAreaPluginsFolder);
flag = true;
}
string str8 = Path.Combine(stagingAreaPluginsFolder, Path.GetFileName(desc.pluginPath));
if (!Directory.Exists(str8) && !File.Exists(str8))
{
if (Directory.Exists(desc.pluginPath))
{
FileUtil.CopyDirectoryRecursive(desc.pluginPath, str8);
}
else
{
FileUtil.CopyFileIfExists(desc.pluginPath, str8, false);
}
}
}
}