Esempio n. 1
0
        public static PluginImporter[] GetImporters(string platformName)
        {
            List <PluginImporter> list = new List <PluginImporter>();
            Dictionary <string, PluginImporter> dictionary = new Dictionary <string, PluginImporter>();

            PluginImporter[] array = (from imp in PluginImporter.GetAllImporters()
                                      where PluginImporter.IsCompatible(imp, platformName)
                                      select imp).ToArray <PluginImporter>();
            IPluginImporterExtension pluginImporterExtension = ModuleManager.GetPluginImporterExtension(platformName);

            if (pluginImporterExtension == null)
            {
                pluginImporterExtension = ModuleManager.GetPluginImporterExtension(BuildPipeline.GetBuildTargetByName(platformName));
            }
            PluginImporter[] result;
            if (pluginImporterExtension == null)
            {
                result = array;
            }
            else
            {
                int i = 0;
                while (i < array.Length)
                {
                    PluginImporter pluginImporter = array[i];
                    string         text           = pluginImporterExtension.CalculateFinalPluginPath(platformName, pluginImporter);
                    if (!string.IsNullOrEmpty(text))
                    {
                        PluginImporter pluginImporter2;
                        if (!dictionary.TryGetValue(text, out pluginImporter2))
                        {
                            dictionary.Add(text, pluginImporter);
                        }
                        else if (pluginImporter2.GetIsOverridable() && !pluginImporter.GetIsOverridable())
                        {
                            dictionary[text] = pluginImporter;
                            list.Remove(pluginImporter2);
                        }
                        else if (pluginImporter.GetIsOverridable())
                        {
                            goto IL_106;
                        }
                        goto IL_FD;
                    }
                    goto IL_FD;
IL_106:
                    i++;
                    continue;
IL_FD:
                    list.Add(pluginImporter);
                    goto IL_106;
                }
                result = list.ToArray();
            }
            return(result);
        }
Esempio n. 2
0
 public static PluginImporter[] GetImporters(string platformName)
 {
     return((from imp in PluginImporter.GetAllImporters()
             where PluginImporter.IsCompatible(imp, platformName)
             select imp).ToArray <PluginImporter>());
 }
Esempio n. 3
0
 public static PluginImporter[] GetImporters(string buildTargetGroup, string buildTarget)
 {
     return((from imp in PluginImporter.GetAllImporters()
             where PluginImporter.IsCompatible(imp, buildTargetGroup, buildTarget)
             select imp).ToArray <PluginImporter>());
 }