Ejemplo n.º 1
0
        private Vector3 GetNewPosition()
        {
            var newPos = LookingDirectionHelpers.GetObjectBeforeObstruction(gameObject, MaxDistance,
                                                                            DistanceBeforeObstruction, LayerMask, _stabilizer);

            return(newPos);
        }
 private void MoveText()
 {
     _isBusy = true;
     LeanTween.move(gameObject,
                    LookingDirectionHelpers.CalculatePositionDeadAhead(), _moveTime).
     setEaseInOutSine().setOnComplete(() => _isBusy = false);
 }
Ejemplo n.º 3
0
        void Update()
        {
            if (_startTime > Time.time)
            {
                return;
            }
            if (_originalScale == null)
            {
                _originalScale = transform.localScale;
            }

            if (!CheckHideWhenMoving())
            {
                return;
            }

            if (CameraMovementTracker.Instance.Distance > DistanceMoveTrigger ||
                CameraMovementTracker.Instance.RotationDelta > DeltaRotationTrigger ||
                _isJustEnabled)
            {
                _isJustEnabled = false;
                MoveIntoView();
            }
#if UNITY_EDITOR
            if (_showDebugBoxcastLines)
            {
                LookingDirectionHelpers.GetObjectBeforeObstruction(gameObject, MaxDistance,
                                                                   DistanceBeforeObstruction, LayerMask, _stabilizer, true);
            }
#endif
        }
Ejemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     if (!isGridCreated)
     {
         CreateGrid(LookingDirectionHelpers.CalculatePositionDeadAhead(2.0f));
         isGridCreated = true;
     }
 }
    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);
        }
    }
Ejemplo n.º 6
0
        // Update is called once per frame
        void Update()
        {
            if (!_isActive || _isBusy)
            {
                return;
            }

            _isBusy = true;
            LeanTween.moveLocal(transform.gameObject,
                                LookingDirectionHelpers.GetPositionInLookingDirection(), MoveTime).
            setEase(LeanTweenType.easeInOutSine).
            setOnComplete(MovingDone);
        }
Ejemplo n.º 7
0
        void Update()
        {
            if (Time.time > _lastPollTime)
            {
                _lastPollTime = Time.time + PollInterval;
                LeanTween.move(gameObject, GetNewPosition(), 0.5f).setEaseInOutSine();
            }
#if UNITY_EDITOR
            if (_showDebugBoxcastLines)
            {
                LookingDirectionHelpers.GetObjectBeforeObstruction(gameObject, MaxDistance,
                                                                   DistanceBeforeObstruction, LayerMask, _stabilizer, true);
            }
#endif
        }
Ejemplo n.º 8
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();
        }
    }
Ejemplo n.º 9
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;
             }
         }
     }
 }
Ejemplo n.º 10
0
        // Update is called once per frame
        void Update()
        {
            if (_isBusy || _startTime > Time.time)
            {
                return;
            }

            var newPos = LookingDirectionHelpers.GetPostionInLookingDirection(2.0f,
                                                                              GazeManager.Instance.Stabilizer);

            if ((newPos - _lastMoveToLocation).magnitude > DistanceTrigger || _isJustEnabled)
            {
                _isJustEnabled = false;
                var maxDelta = CollisonDetector.GetMaxDelta(newPos - transform.position);
                if (maxDelta != Vector3.zero)
                {
                    _isBusy = true;
                    newPos  = transform.position + maxDelta;
                    LeanTween.moveLocal(gameObject, transform.position + maxDelta,
                                        2.0f * maxDelta.magnitude / Speed).setEaseInOutSine().setOnComplete(MovingDone);
                    _lastMoveToLocation = newPos;
                }
            }
        }
 void Update()
 {
     Debug.Log(LookingDirectionHelpers.GetPostionInLookingDirection(2.0f, GazeManager.Instance.Stabilizer));
 }
 protected override void Update()
 {
     _instructionTextMesh.text =
         LookingDirectionHelpers.GetPositionOnSpatialMap(_maxDistance) != null ?
         "Tap to select a location" : _lookAtSurfaceText;
 }