A
A
annas_082021-07-05 13:26:51
Unity
annas_08, 2021-07-05 13:26:51

Is it possible to combine c# and c++ in a Unity project?

Please tell me, is it possible to use not pure c# in Unity, but combine c# and c++ (and if it is possible how to implement this)?
That is, the game framework should be written in c#, and everything else in c++.
And in general, how are unity games written (meaning large projects): in pure c#, or are there ways to combine several languages, and write only a framework in c#?
If so, is it often used?
And most importantly: is the game worth the candle, or is it better to just use Unreal Engine for c ++?
And which engine do you think is better?
(On the Internet, the information is very chaotic, and I rather got confused in this matter)

PS Also, please tell me if it is possible to combine
c++ and c#, do you need something special for this (or include a file and call a c# function/method in c++ code)? How can this be done?

PPS Using only c# is not an option, I'm almost not familiar with it.

If someone knows - please tell me the literature on this issue)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2021-07-05
@GavriKos

Theoretically - this is quite possible - you connect the usual libraries (dll and others) and work with them. But you need to understand that then you need to manually support them for all platforms. It is possible to intervene on other lower levels, in general, it is possible.
If c# scares you so much (which, by the way, in vain - a good convenient language) - then you should certainly look in the direction of other engines. But don't forget about target platforms ;-)

T
Txao, 2021-07-05
@Txao

https://gamedev.stackexchange.com/questions/82518/...

And in general, how are unity games written (meaning large projects)

Unity doesn't write big projects
If so, is it often used?

Infrequently
And most importantly: is the game worth the candle, or is it better to just use Unreal Engine for c ++?

It all depends on the complexity of the project

V
Vasily Bannikov, 2021-07-05
@vabka

That is, the game framework should be written in c#, and everything else in c++.

What for? What problem will it solve? C# + DOTS too slow?
Using only c# is not an option, I am almost not familiar with it.

If C# scares you that much, then you are probably almost unfamiliar with C ++
. I advise you not to be afraid and try to dive into C # - you will like it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question