示例#1
0
        // Update is called once per frame
        void Update()
        {
            //Debug.Log("MousePos: " + Input.mousePosition);

            VirtualMouseData mouseData = _session.GetVirtualMouseData();
            var screenPos = new Vector3(Screen.width - mouseData.screenY, Screen.height - mouseData.screenX, 0);

            //Debug.Log("ScreenPos: " + screenPos);
            //Debug.Log("JoyStickData, error:" + mouseData.success + ", size: " + mouseData.size + ", screenX: " + mouseData.screenX + ", screenY: " + mouseData.screenY);

            if (DebugModel != null)
            {
                var   ray      = Camera.current.ScreenPointToRay(screenPos);
                float distance = (100 * 0.1f) / mouseData.size;
                var   pos      = ray.GetPoint(distance);
                DebugModel.position = pos;
            }
        }