コード例 #1
0
        protected virtual void CreateVRCursorHand(QuickUICursor.Role cType, Transform tHand, Transform tDistal)
        {
            Transform tIntermediate = tDistal.parent;
            Transform tProximal     = tIntermediate.parent;
            float     l1            = Vector3.Distance(tDistal.position, tIntermediate.position);
            float     l2            = Vector3.Distance(tIntermediate.position, tProximal.position);
            Transform cursorOrigin  = tHand.CreateChild("__CursorOrigin__");

            cursorOrigin.forward  = (tIntermediate.position - tProximal.position).normalized;
            cursorOrigin.position = tProximal.position + cursorOrigin.forward * (l1 + l2 + (l2 - l1));

            QuickUICursor.CreateVRCursor(cType, cursorOrigin);
        }
コード例 #2
0
        protected virtual void Awake()
        {
            if (!Camera.main)
            {
                Camera camera = _pfCamera ? Instantiate <Camera>(_pfCamera) : new GameObject().GetOrCreateComponent <Camera>();
                camera.name = "__Camera__";
                camera.tag  = "MainCamera";
                camera.gameObject.GetOrCreateComponent <FlareLayer>();
            }

            _camera = Camera.main;
            _camera.transform.parent = transform;
            _camera.transform.ResetTransformation();
            _camera.GetOrCreateComponent <AudioListener>();

            if (!QuickVRManager.IsXREnabled())
            {
                _camera.fieldOfView = 70.0f;//90.0f;
            }

            QuickUICursor.CreateVRCursor(QuickUICursor.Role.Head, _camera.transform);
        }