Exemplo n.º 1
0
        private async Task <ISpatialCoordinate> TryCreateCoordinateEditorAsync(Vector3 worldPosition, Quaternion worldRotation, CancellationToken cancellationToken)
        {
            ISpatialCoordinate simulatedCoordinate = new SimulatedSpatialCoordinate <string>($"{simulatedCoordinateIdPrefix}{Guid.NewGuid().ToString()}", worldPosition, worldRotation);

            Debug.Log("Created artificial coordinate for debugging in the editor, waiting five seconds to fire creation event.");
            await Task.Delay(simulatedCoordinateDetectionDelay, cancellationToken).IgnoreCancellation();

            return(await Task.FromResult(simulatedCoordinate));
        }
Exemplo n.º 2
0
        private async Task OnDiscoverCoordinatesEditorAsync(CancellationToken cancellationToken, string[] idsToLocate = null)
        {
            if (idsToLocate == null ||
                idsToLocate.Length != 1)
            {
                Debug.LogError("SpatialAnchorsCoordinateService only supports simulation for one coordinate currently, localization failed.");
                return;
            }

            ISpatialCoordinate simulatedCoordinate = new SimulatedSpatialCoordinate <string>(idsToLocate[0], Vector3.zero, Quaternion.identity);

            OnNewCoordinate(simulatedCoordinate.Id, simulatedCoordinate);
            await Task.CompletedTask;
        }