Ejemplo n.º 1
0
        private static void ResolveAssemblyToLayerResolver(MelonCompatibilityLayer.LayerResolveEventArgs args)
        {
            if (args.inter != null)
            {
                return;
            }

            IEnumerable <Type> plugin_types = args.assembly.GetValidTypes(x => x.GetInterface("IPlugin") != null);

            if ((plugin_types == null) ||
                (plugin_types.Count() <= 0))
            {
                return;
            }

            args.inter = new IPA_CL(args.assembly, args.filepath, plugin_types);
        }
Ejemplo n.º 2
0
        private static void ResolveAssemblyToLayerResolver(MelonCompatibilityLayer.LayerResolveEventArgs args)
        {
            if (args.inter != null)
            {
                return;
            }

            IEnumerable <Type> melon_types = args.assembly.GetValidTypes(x => x.IsSubclassOf(typeof(MelonBase)));

            if ((melon_types == null) ||
                (melon_types.Count() <= 0))
            {
                return;
            }

            if (string.IsNullOrEmpty(args.filepath))
            {
                args.filepath = args.assembly.GetName().Name;
            }
            args.inter = new Melon_CL(args.assembly, args.filepath);
        }