I used to use Unreal to work with Cesium where I used Blueprint to set up the logic to spawn objects in the scene from the DataTable/Json that I received where we had the coordinates and those coordinates were used to position the objects in the scene by adding a Globe Anchor to those objects.
Due to situations of need and prototyping for another project I am forced to use Unity and I can’t have the slightest idea of how to program this logic in C#. I don’t even know where to study how to program this in C#, to be honest, since I didn’t find any documentation to study how to program with this plugin. Help me please, I’m in an urgent situation.
The best way to learn how to use Cesium for Unity programmatically is to look at the comments in the source code. For example, here’s the source for CesiumGlobeAnchor, which is the Cesium for Unity equivalent of Cesium for Unreal’s CesiumGlobeAnchorComponent:
This class derives from MonoBehaviour, so using it is much like any other Unity component. Something like this will get you started (I haven’t tested this, but it should be close):
// at the top
using CesiumForUnity;
using Unity.Mathematics;
// when you want to create an anchored object
GameObject go = new GameObject();
CesiumGlobeAnchor anchor = go.AddComponent<CesiumGlobeAnchor>();
anchor.longitudeLatitudeHeight = new double3(longitude, latitude, height);
I can’t really help you with the data table / JSON side of it, but I’m sure there are C# libraries and tutorials that can help you through that part.