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);
        }
    }
Пример #2
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);
        }