I would like to stream 3D Tiles from our own cloud into Unity with the “Tileset Source” -Option set to “From Url”. However my content is private and I use custom cookies in http request header to authenticate request. What scripts or classes should I modify to develop this feature. Normally in Unity I would use:
but now I probably have to deal with c++ also and I do not have a proper knowledge to get started with. Could someone help with this? I am happy to share the outcome to the community.
We have an API that generates the signed cookie based on user authentication every time user starts Unity runtime application whre most of the application is done i c# already. The cookie is then stored in c# side to be used in various unitywebrequests. I thought that storing this cookie in some c# static property and using reinterop I could fetch the cookie using c++ UnityAssetAccessor.cpp to be used there. I tried setting static property into Cesium3Dtileset.cs and into my own custom class to store it there for c++ usage without success. Perhaps i just had something wrong with my setup when trying this.
Perhaps there is much more easier way to achieve this but anyway I need somehow to get the signed cookie to be transferred from c# side into the loader that loads tileset from url (unitywebrequest in unityassetaccessor) via code. Getting and setting cookie from API is done runtime so cookie should be handled via c# and not as user input via editor.
Any thoughts what might be the right way to continue?
Sounds like you’re on the right track. After you added your property to Cesium3DTileset.cs, did you also add some code that accesses it to ConfigureReinterop.cs? That file is what tells Reinterop what to expose to C++.
This blog post might be helpful, if you haven’t seen it already:
After trial and error I noticed that I was modifying ConfigureReinterop.cs in Runtime-folder but everything started to work when I also made the modifications into ConfigureReinterop.cs in Editor-Folder.