示例#1
0
        void Update()
        {
            if (!IsRecording)
            {
                return;
            }

            if (_inputSource == null)
            {
                return;
            }

            Vector3 inputSourcePosition = Vector3.zero;

            if (!_inputSource.TryGetGripPosition(_inputSourceUID, out inputSourcePosition))
            {
                return;
            }

            float x, y;

            CustomGestureRecognizer.Instance.GetInputSourceRelativePosition(inputSourcePosition, out x, out y);

            if (x < 0 || x > 1 || y < 0 || y > 1)
            {
                return;
            }

            GridDrawer.Paint(x, y);
        }
        public void PaintAccordingToGripPosition(IInputSource inputSource, uint inputSourceUID)
        {
            Vector3 inputSourcePosition = Vector3.zero;

            if (!inputSource.TryGetGripPosition(inputSourceUID, out inputSourcePosition))
            {
                return;
            }

            float x, y;

            GetInputSourceRelativePosition(inputSourcePosition, out x, out y);

            if (x < 0 || x > 1 || y < 0 || y > 1)
            {
                return;
            }

            GridDrawer.Paint(x, y);
        }