Using unity project as a 3D frontend being a DLL in an existing solution?

Hello,

I am already creating a game with unity, so I have a Basic unity Knowledge.

But I do not know, can a unity Project be compiled to a DLL (not only scripts, also ui) and be used in some other Project?

The Background:
There is an Delphi solution which talks to some machine cutting blocks.
The existing solution uses an own DLL (COM Interface) to exchange data with a (ugly) Delphi DLL which visualizes it 3D with some OpenGL interface(ugly).

This 3D frontend part should be replaced now. It is currently a DLL.
So I would have to Import the other COM dll to get the 3d data from it, this should be no Problem, right?

But then my unity Project could it be compiled to a DLL? I only made Windows executalbes until now…

Thanks a lot for an info if this is possible!

I don’t believe you can compile to a dll (someone correct me if that’s wrong). However, you should be able to replace the Delphi DLL with your own DLL (not using Unity) that implements the same interface, and then forward the data it gets from the COM interface on to your standalone Unity app using some form of interprocess communication.

I kind of miss Delphi. Still the best IDE I’ve used to date, but there were always hackiness you had to do to get it to work with new things - always a few steps behind.

Would it be possible for unity to run in some other window / Container / Gui component, maybe WPF or at least draw into a Container the new “own” dll offers?

Thanks for your help!

It’s possible to pass a parent window handle from the command line. From the command line parameter documentation:

There’s sample code in the documentation. I’ve never done it, don’t know how clean it is.

Yes. Found it myself too and the demo Project “EmbeddedWindow”. which crashes when I start it. Will create a new Topic for the Problem.

Thanks so far! At least I have an idea now how it could be done…