Can I convert my dot net library to work with unreal?

I have been creating a graphical library for another game engine in C#. It uses only basic dot net functionality such as System.Math and System.Collections. It returns an array of bytes as an image.

I was thinking that I would also like to port it to the Unreal engine. Since it could be used to make procedural textures.

So is there some easy way I can port this library to work with Unreal? Or will it be a case of using search and replace to edit the file to make it into a C library?

Well try to add a reference dont know how well vs c++ goes with .net stuff but it should work in some way

maybe this helps?

I’m in the process of porting over a C# game prototype into UE4 and C++. The process is mostly a matter of translating C# code and all the library calls into C++ with UE4 engine calls. There’s no easy way to do it, at least for me. The good news about porting code is that most of the logic has already been taken care of, so it goes a lot faster than rewriting it all from scratch.

You could create a C++ wrapper around your .NET code using a mix of unmanaged and managed C++. If you make your unmanaged C++ code accessible through a Windows .DLL file, you could probably import those into your game C++ code.

Interesting. The library doesn’t call any other functions except Math functions so if I could quickly make a wrapper and test it with Unreal that would be nice. Calling some functions and getting a byte array back to use as a texture. I’m wondering if the wrapper method builds the virtual machine into the library or would the game then only work on PCs with dot net virtual machine installed?

Hang on just seen this: Looks like it’s still in preview stage but seems to convert C sharp code to native code! Wow.

Probably take me longer to work all this stuff out rather than just go through the file and manually change things. But it’s more fun this way!

Perhaps this will be a way of using C sharp with Unreal engine when Visual Studio 2015 comes out!

When using the current .NET platform, the user will indeed need to have .NET installed. Microsoft .NET Native that you linked seems to compile to self-contained native executables. Sounds like fun!


There is mono support for UE4.

I don’t know much about this project.

However .NET already is confirmed for all platforms, and .NET is open source now. (GitHub - microsoft/dotnet: This repo is the official home of .NET on GitHub. It's a great star)

But i think you should convert your C# classes to C++ classes. So you can reuse them later in other c++ projects.