/// <summary> /// Unity's Update method. /// </summary> public void Update() { // Get the current Pose. ApiPose apiPose = AnchorApi.GetAnchorPose( ARCoreExtensions._instance.currentARCoreSessionHandle, _anchorHandle); _pose = apiPose.ToUnityPose(); // Update the Geospatial Anchor transform to match. transform.localPosition = _pose.position; transform.localRotation = _pose.rotation; }
/// <summary> /// Unity Update method. /// </summary> public void Update() { #if UNITY_EDITOR _pose = ARCoreCloudAnchorsEditorDelegate.Instance.GetAnchorPose(ARCoreExtensions._instance.currentARCoreSessionHandle, _anchorHandle); #endif if (!Application.isEditor) { // Get the current Pose. ApiPose apiPose = AnchorApi.GetAnchorPose( ARCoreExtensions._instance.currentARCoreSessionHandle, _anchorHandle); _pose = apiPose.ToUnityPose(); } // Update the Cloud Anchor transform to match. transform.localPosition = _pose.position; transform.localRotation = _pose.rotation; }