/// <summary> /// Starts device tracking. /// </summary> /// <param name="locationTrackingMode"> /// </param> public async Task StartTrackingAsync(ARLocationTrackingMode locationTrackingMode = ARLocationTrackingMode.Ignore) { _locationTrackingMode = locationTrackingMode; if (locationTrackingMode != ARLocationTrackingMode.Ignore) { if (LocationDataSource == null) { throw new InvalidOperationException("Cannot use location tracking without the LocationDataSource property being initialized"); } #if __ANDROID__ if (!RequestLocationPermission()) { return; } #endif await LocationDataSource.StartAsync(); } CameraController = _controller; var currentTrackingValue = IsTracking; OnStartTracking(); IsTracking = true; if (!currentTrackingValue) { IsTrackingStateChanged?.Invoke(this, true); } }
/// <summary> /// Starts device tracking. /// </summary> public System.Threading.Tasks.Task StartTrackingAsync(ARLocationTrackingMode locationTrackingMode = ARLocationTrackingMode.Ignore) { #if !NETSTANDARD2_0 var nativeView = NativeARSceneView(); if (nativeView == null) { throw new InvalidOperationException("Cannot start tracking before the view has appeared"); } return(nativeView.StartTrackingAsync(locationTrackingMode)); #else throw new PlatformNotSupportedException(); #endif }