Hello, I have one problem. I am creating android app using AR and Cesium, and I want to spawn objects in code.
When I drag and drop them in Unity, everything works perfectly, but I want to spawn it in code, so it will be easier to spawn more items then drag and dropping each.
Is there any built in function that takes longitude, latitude, altitude, and prefab, and spawns it on map.
I tried something like
GeospatialController.Instance.AddLocation(lat, long, GeospatialAssetPrefab)
or
var anchor =GeospatialController.AnchorManager.AddAnchor(lat, long,alt ,quaternion);
var anchoredAsset = Instantiate(GeospatialAssetPrefab, anchor.transform);
(i found this one on Use Geospatial anchors to position real-world content on Unity | ARCore | Google for Developers , but I am doing something wrong cause it says:
An object reference is required for the non-static field, method, or property ‘GeospatialController.AnchorManager’
I am writing everything in my script, with
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using TMPro;
using Google.XR.ARCoreExtensions.Samples.Geospatial;
using UnityEngine.Networking;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;