Is there a way to reference C# library DLLs?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By YoukaiCountry
:warning: Old Version Published before Godot 3 was released.

One of the biggest reasons I find C# in Godot exciting is the ability to load some of the numerous external libraries that exist in the language.

I have successfully compiled Godot with Mono, but have yet to find a way to reference external DLLs.

Is there currently a way to do this?

I use Xamarin studio: open your project and add them as references. You could also use Visual Studio or even VS Code (if you know how to modify the .project file). Or are you trying to use unmnaged code?

davidoc | 2017-10-30 18:27

Are you trying to take an assembly, and use its functions and whatnot in a Godot project?

Ertain | 2017-11-01 00:47

I’ll give Xamarin a shot, thanks for the suggestion. Not trying for unmanaged code, just .net/mono assemblies.

Ertain:
Basically I just want to use general C# code that I or other have created, and reference them in Godot via C#. For example I have C# code that generates randomized noise that I would like to access within Godot.

YoukaiCountry | 2017-11-03 15:24

YouKaiCountry: If you want to access the noise generator in Godot tool editor so that you can integrate with AudioPlayer, you must create a c++ module. No other way around it.

If you have access to raw pcm samples, then all you need to do is extend AudioStreamResampled

https://github.com/hungrymonkey/godot/blob/set_stream_bug/modules/dummy_audiostream/dummy_audiostream.cpp

here is an example of an 631 hz tone generator.

hungrymonkey | 2017-11-11 19:40

The code was developed with std_vorbis as an example

https://github.com/hungrymonkey/godot/blob/set_stream_bug/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp

hungrymonkey | 2017-11-11 19:48