Cesium-unity-native

Hello! Is the file under path ‘Packages\com.cesium.unity\native~\Editor\generated-Editor’ automatically generated? If I want to create a new script in C #, such as “cesium_temp. cs”, in order to communicate with C++native, will the corresponding file’s include and src automatically generate the corresponding file? For example: (cesium_temp. h or cesium_temp. cpp)

Yes, it’s generated. You can read more about how our C# / C++ interop works here:

hi .I have got question about Cesium?
cesium blocked in Russia and Ukranie?

Thank you. I have found a way to generate it. But there is another question, how to debug native c++code in Unity?

how to debug native c++code in Unity?

Use Visual Studio or Visual Studio Code to attach to the Unity process.

Thank you for the prompt! Following your suggestion, I have selected ‘Additional Unity Debugger’ and also selected the Unity instance in ‘CesiumForUnityNative. sln’. But when Unity started, there was no response.


无标题

If you want to debug the native code, you need to use a native debugger, not the Unity one. It’s not possible to debug the Unity C# code and the C++ code at the same time using a single debugger. But you can attach two different ones. For example, I often use Visual Studio (Debug → Attach Unity Debugger) to debug the C# code and Visual Studio Code (there’s a configuration called “(Windows) Attach” defined in the native~ subdirectory from cesium-unity) to debug the C++ code.