Jump to content

Calling C# scripts from C++


photo

Recommended Posts

Hi All,

 

Just to confirm - there is no way to call c# scripts from a C++ application correct?

 

You can call UnigineScript from C++ and you can also access UnigineScript from a C# app.  But it's currently not possible to mix C# and C++ in the same application?

 

Is this correct or is there a solution to this?

 

Any help would be appreciated.

 

Cheers,

Simon

 

 

 

 

 

Link to comment

Hi Simon,

 

Unigine is designed to be embedded into the C++ or C# application and has no capability of C# scripting as it is in Unity.

This may change in future, but now the only scripting language available is UnigineScript.

 

Even without help from the engine, you can still mix C++ and C# in your application.

The method of calling unmanaged functions from C# is quite well known and is called P/Invoke.

 

But calling the C# code from the C++ is a way trickier.

Some cases can be solved using a technique called Reverse P/Invoke and we use it ourselves in our C# API implementation.

Depending on your task it may be more practical to write intermediary C++/CLI library but this approach is only available on Windows.

 

I can also imagine a very twisted way of using UnigineScript as an intermediary, but I hope you'll ignore this idea :)

Link to comment
×
×
  • Create New...