Beispiel #1
0
    private void UpdateCurrentPosition(AnchorPosition anchorPos)
    {
        if (inNavigationMode)
        {
            Debug.Log($"User's current position is around '{anchorPos.SpatialAnchorObject.Name}'");
            Debug.Log(anchorList.Count);
            // remove anchorPos from anchor list
            anchorList.Remove(anchorPos.SpatialAnchorObject.Name);
            anchorPos.AnchorPassed();
            anchorPos.ResetBoxCollider();

            // update target to the next anchor
            if (anchorList.Count > 0)
            {
                foreach (AnchorPosition sceneAnchorPos in SceneAnchorPositions)
                {
                    //if(sceneAnchorPos.SpatialAnchorObject.Name == anchorList.First anchorList[1])
                    if (sceneAnchorPos.SpatialAnchorObject.Name == anchorList.First.Value)
                    {
                        Debug.Log($"Set the target to the next anchor '{sceneAnchorPos.SpatialAnchorObject.Name}'");
                        indicator.GetComponent <PositionIndicator>().SetTarget(sceneAnchorPos.transform);
                    }
                }
            }
            else
            {
                SetInNavigationMode(false);
                foreach (AnchorPosition sceneAnchorPos in SceneAnchorPositions)
                {
                    // reset box collider
                    sceneAnchorPos.ResetBoxCollider();
                }
                dialogController.OpenDialogSimple("You've reached your destination!!", "Congratulations! You have successfully reached your destination.");
                indicator.SetActive(false);
            }
        }
    }
Beispiel #2
0
    private void UpdateCurrentPosition(AnchorPosition anchorPos)
    {
        if (inNavigationMode)
        {
            Debug.Log($"User's current position is around '{anchorPos.SpatialAnchorObject.Name}'");
            Debug.Log(anchorList.Count);
            // remove anchorPos from anchor list
            anchorList.Remove(anchorPos.SpatialAnchorObject.Name);
            anchorPos.AnchorPassed();
            anchorPos.ResetBoxCollider();

            // update target to the next anchor
            if (anchorList.Count == 0)
            {
                SetInNavigationMode(false);
                foreach (AnchorPosition sceneAnchorPos in SceneAnchorPositions)
                {
                    // reset box collider
                    sceneAnchorPos.ResetBoxCollider();
                }
                dialogController.OpenDialogSimple("You've reached your destination!!", "Congratulations! You have successfully reached your destination.");
            }
        }
    }