public void OnPointerDown(MixedRealityPointerEventData eventData)
    {
#if !UNITY_EDITOR
        var foundPosition = LookingDirectionHelpers.GetPositionOnSpatialMap(_maxDistance);
#else
        Vector3?foundPosition = LookingDirectionHelpers.GetPositionInLookingDirection(_maxDistance);
#endif
        if (foundPosition != null)
        {
            Instantiate(_objectToPlace, foundPosition.Value, Quaternion.identity, _container.transform);
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (_foundPosition == null && Time.time > _delayMoment)
        {
            //Debug.Log(GazeManager.Instance.Stabilizer);

            //var lier = GazeManager.Instance.Stabilizer;
            _foundPosition = LookingDirectionHelpers.GetPositionOnSpatialMap(maxDistance, GazeManager.Instance.Stabilizer);
            if (_foundPosition != null)
            {
                if (GazeManager.Instance.Stabilizer.StablePosition.y - _foundPosition.Value.y <= minHeight)
                {
                    Reset();
                    Debug.Log("reseted");
                }
                else
                {
                    Debug.Log("found");
                    current_foor_loc_height = _foundPosition.Value.y;
                    LabelText.enabled       = false;
                }
            }
            else
            {
                Reset();
                Debug.Log("found null");
            }
        }

        if (_foundPosition != null && tempCounter_ > 0)
        {
            update_foot_location();
            add_foot_object_to_scene();
            tempCounter_ -= 1;
            ((GameObject)footprints[currentStep]).GetComponent <Renderer>().material.color     = Color.blue;
            ((GameObject)footprints[currentStep + 1]).GetComponent <Renderer>().material.color = Color.red;
        }

        if (_foundPosition != null && Time.time > _delayMoment)
        {
            LabelText.enabled = false;
            removeIfNearby();
        }
    }
Beispiel #3
0
 void Update()
 {
     if (_foundPosition == null && Time.time > _delayMoment)
     {
         _foundPosition = LookingDirectionHelpers.GetPositionOnSpatialMap(MaxDistance,
                                                                          GazeManager.Instance.Stabilizer);
         if (_foundPosition != null)
         {
             if (GazeManager.Instance.Stabilizer.StablePosition.y - _foundPosition.Value.y > MinHeight)
             {
                 Messenger.Instance.Broadcast(new PositionFoundMessage(_foundPosition.Value));
                 PlayConfirmationSound();
             }
             else
             {
                 _foundPosition = null;
             }
         }
     }
 }
 protected override void Update()
 {
     _instructionTextMesh.text =
         LookingDirectionHelpers.GetPositionOnSpatialMap(_maxDistance) != null ?
         "Tap to select a location" : _lookAtSurfaceText;
 }