Exemplo n.º 1
0
        public void Init(IPublicApi api)
        {
            api_ = api;

            PluginInitContext context = new PluginInitContext();

            context.Api = api;

            var PluginFileList = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location))
                                 .Where(x => Path.GetFileName(x).StartsWith("CozyLauncher.Plugin.") && x.EndsWith(".dll"));

            foreach (var p in PluginFileList)
            {
                IPluginLoader pl = new CSharpPluginLoader(p);
                plugins_.AddRange(pl.GetPlugins(context).AsEnumerable());
            }

            var LuaPluginFileList = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location))
                                    .Where(x => Path.GetFileName(x).StartsWith("CozyLauncher.Plugin.") && x.EndsWith(".lua"));

            foreach (var p in LuaPluginFileList)
            {
                IPluginLoader pl = new LuaPluginLoader(p);
                plugins_.AddRange(pl.GetPlugins(context).AsEnumerable());
            }

            plugins_.AddRange(CppPluginLoader.Instance.GetPlugins(context).AsEnumerable());
        }
Exemplo n.º 2
0
        public void Init(IPublicApi api)
        {
            api_ = api;

            PluginInitContext context = new PluginInitContext();
            context.Api = api;

            var PluginFileList = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location))
                .Where(x => Path.GetFileName(x).StartsWith("CozyLauncher.Plugin.") && x.EndsWith(".dll"));
            foreach (var p in PluginFileList)
            {
                IPluginLoader pl = new CSharpPluginLoader(p);
                plugins_.AddRange(pl.GetPlugins(context).AsEnumerable());
            }

            var LuaPluginFileList = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location))
                .Where(x => Path.GetFileName(x).StartsWith("CozyLauncher.Plugin.") && x.EndsWith(".lua"));
            foreach (var p in LuaPluginFileList)
            {
                IPluginLoader pl = new LuaPluginLoader(p);
                plugins_.AddRange(pl.GetPlugins(context).AsEnumerable());
            }

            plugins_.AddRange(CppPluginLoader.Instance.GetPlugins(context).AsEnumerable());
        }