Because of the task below, I am writing a test code that calls the Unity GameObject class method from the Cesium3DTilesSelection::Tile class method.
I don’t know how it works by converting the relative path to the absolute path on the build PC and adding it to the Visual Studio project include. (just like CesiumForUnityNative-Runtime project)
I’m not sure if I completely understand the question, but it sounds like you’re trying to call into Unity from cesium-native code. That won’t work because the dependency doesn’t go in that direction. You probably need to do something along the lines of adding an interface to cesium-native that can be implemented in cesium-unity. That way cesium-native can call your Unity-dependent functionality without depending directly on Unity itself.
You are correct. I am trying to calling Unity methods from cesium-native code.
Of course, I know that modifying it like this is not appropriate when considering contribution to cesium-native, but it is to test what I think.
I’m curious about the following:
When I open the CesiumForUnityNative-Runtime project properties window, there are include paths as shown below. The relative path has been added as an absolute path, and I am curious about where this processing takes place. I’ve been looking into how it works, but haven’t figured it out myself yet.
I guess CMake is adding the absolute paths? I’m not sure.
If you’re just hacking something to test, you can probably just open the cesium-native CMakeLists.txt for the library you want to call into Unity, and add the absolute path to the generated Unity header files to target_include_directories. I’ve never tried this, but I can’t think of a reason it wouldn’t work.