Exemplo n.º 1
0
        public override void Draw()
        {
            if (_model == null)
            {
                return;
            }
            base.Draw();

            if (Event.current.type == EventType.Repaint)
            {
                foreach (var obj in _obj)
                {
                    obj.transform.Rotate(0, 0.5f, 0);
                }

                if (CameraLeft.gameObject.activeSelf)
                {
                    CameraLeft.Render();
                    if (CameraRight != null)
                    {
                        CameraRight.Render();
                    }
                }

                GUI.DrawTexture(ZoomInRect, _plusIcon);
                GUI.DrawTexture(ZoomOutRect, _minusIcon);
            }
        }
    /// <summary>
    /// Check and update the camera configuration if dirty.
    /// </summary>
    void Update()
    {
        // Handle all other camera updates here
        if (UpdateCamerasDirtyFlag == false)
        {
            return;
        }
        UpdateCamerasDirtyFlag = false;

        // Configure left and right cameras
        float eyePositionOffset = -IPD * 0.5f;

        ConfigureCamera(CameraLeft, eyePositionOffset);

        eyePositionOffset = IPD * 0.5f;
        ConfigureCamera(CameraRight, eyePositionOffset);

        // Make sure the mocap transform is set.
        if (CameraRight)
        {
            MocapSocket mocap = CameraRight.GetComponent <MocapSocket>();
            mocap.VRoamTransform = VRoamCompass.transform;
        }
    }