Example #1
0
    void Update()
    {
#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.R))
        {
            CloseBox();
        }
#endif
        if (isShow)
        {
            time += Time.deltaTime;
            if (time >= timeEnd)
            {
                ReleaseDestory();
                NxrReticle mNxrReticle = NxrViewer.Instance.GetNxrReticle();
                if (mNxrReticle)
                {
                    mNxrReticle.OnGazeExit(null, null);
                }
            }
        }
    }
Example #2
0
        public void OnGazeTrigger()
        {
            bool isDraging = dragableItem != null && dragableItem.IsDraging;

            if (!IsSelected && !isDraging)
            {
                return;
            }

            if (!isDraging)
            {
                NxrLaserPointer nxrLaserPointer = NxrPlayerCtrl.Instance.GetControllerLaser();
                if (nxrLaserPointer != null)
                {
                    // 选中跟随
                    if (dragableItem != null)
                    {
                        dragableItem.OnBeginDrag(nxrLaserPointer.transform);
                    }
                }
                else
                {
                    // 头部
                    NxrReticle mReticle = NxrViewer.Instance.GetNxrReticle();
                    if (dragableItem != null)
                    {
                        dragableItem.OnBeginDrag(mReticle.gameObject.transform.parent);
                    }
                }
            }
            else
            {
                // 恢复
                if (dragableItem != null)
                {
                    dragableItem.OnEndDrag(parentTrans);
                }
            }
        }