예제 #1
0
MonoAssembly *gdmono_load_assembly_from(const String &p_name, const String &p_path) {

	MonoDomain *domain = mono_domain_get();

	GDMonoAssembly *assembly = memnew(GDMonoAssembly(p_name, p_path));
	Error err = assembly->load(domain);
	ERR_FAIL_COND_V(err != OK, NULL);

	GDMono::get_singleton()->add_assembly(mono_domain_get_id(domain), assembly);

	return assembly->get_assembly();
}
예제 #2
0
MonoAssembly *GDMonoAssembly::_load_assembly_from(const String &p_name, const String &p_path) {

	GDMonoAssembly *assembly = memnew(GDMonoAssembly(p_name, p_path));

	MonoDomain *domain = mono_domain_get();

	Error err = assembly->load(domain);

	if (err != OK) {
		memdelete(assembly);
		ERR_FAIL_V(NULL);
	}

	GDMono::get_singleton()->add_assembly(domain ? mono_domain_get_id(domain) : 0, assembly);

	return assembly->get_assembly();
}