public void SetPropertyMode(VarjoCameraPropertyType type, VarjoCameraPropertyMode mode)
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.SetCameraPropertyMode(type, mode);
     UpdateModes();
     VarjoPluginMR.UnlockCameraConfig();
 }
 public void SetPropertyValue(VarjoCameraPropertyType type, VarjoCameraPropertyValue value)
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.SetCameraPropertyValue(type, value);
     UpdateValues();
     VarjoPluginMR.UnlockCameraConfig();
 }
 void UpdateVREyeOffSet()
 {
     if (VREyeOffset != currentVREyeOffset)
     {
         VarjoPluginMR.SetVRViewOffset(VREyeOffset);
         currentVREyeOffset = VREyeOffset;
     }
 }
 public void ResetProperty(VarjoCameraPropertyType type)
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.ResetCameraProperty(type);
     UpdateValues();
     UpdateModes();
     VarjoPluginMR.UnlockCameraConfig();
 }
 public void ResetAll()
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.ResetCameraProperties();
     UpdateValues();
     UpdateModes();
     VarjoPluginMR.UnlockCameraConfig();
 }
    VarjoCameraPropertyValue GetPropertyValue(VarjoCameraPropertyType type)
    {
        VarjoCameraPropertyValue value;

        if (VarjoPluginMR.GetCameraPropertyValue(type, out value))
        {
            return(value);
        }
        return(default(VarjoCameraPropertyValue));
    }
    VarjoCameraPropertyMode GetPropertyMode(VarjoCameraPropertyType type)
    {
        VarjoCameraPropertyMode mode;

        if (VarjoPluginMR.GetCameraPropertyMode(type, out mode))
        {
            return(mode);
        }
        return(VarjoCameraPropertyMode.Off);
    }
    VarjoCameraPropertyMode[] GetPropertyModes(VarjoCameraPropertyType type)
    {
        List <VarjoCameraPropertyMode> list = new List <VarjoCameraPropertyMode>();

        VarjoCameraPropertyMode[] modes = new VarjoCameraPropertyMode[VarjoPluginMR.GetCameraPropertyModeCount(type)];
        if (VarjoPluginMR.GetCameraPropertyModes(type, out list))
        {
            modes = list.ToArray();
        }
        return(modes);
    }
    VarjoCameraPropertyValue[] GetPropertyValues(VarjoCameraPropertyType type)
    {
        List <VarjoCameraPropertyValue> list = new List <VarjoCameraPropertyValue>();

        VarjoCameraPropertyValue[] values = new VarjoCameraPropertyValue[VarjoPluginMR.GetCameraPropertyValueCount(type)];
        if (VarjoPluginMR.GetCameraPropertyValues(type, out list))
        {
            values = list.ToArray();
        }
        return(values);
    }
 void UpdateVideoSeeThrough()
 {
     if (videoSeeThrough != videoSeeThroughEnabled)
     {
         if (videoSeeThrough)
         {
             videoSeeThrough = VarjoPluginMR.StartRender();
         }
         else
         {
             VarjoPluginMR.StopRender();
         }
         videoSeeThroughEnabled = videoSeeThrough;
     }
 }
        private void OnMRDeviceStatus(bool connected)
        {
            Debug.Log("MR Device status: " + (connected ? "connected" : "disconnected"));

            if (connected)
            {
                VarjoPluginMR.StartRender();
                SetClearColorSolidColor();
            }
            else
            {
                SetClearColorSkybox();
                VarjoPluginMR.StopRender();
            }
        }
        void Start()
        {
            // Register to receive event notifications.
            VarjoManager.OnDataStreamStartEvent        += OnDataStreamStart;
            VarjoManager.OnDataStreamStopEvent         += OnDataStreamStop;
            VarjoManager.OnMRCameraPropertyChangeEvent += OnCameraPropertyChange;
            VarjoManager.OnMRDeviceStatusEvent         += OnMRDeviceStatus;

            // Try to start rendering. If there is no MR support available, this call fails and we
            // fall back to Skybox as the background.
            if (VarjoPluginMR.StartRender())
            {
                SetClearColorSolidColor();
            }
            else
            {
                SetClearColorSkybox();
            }
        }
 void UpdateDepthEstimation()
 {
     if (depthEstimation != depthEstimationEnabled)
     {
         if (depthEstimation)
         {
             originalSubmitDepthValue  = varjoManager.submitDepth;
             varjoManager.submitDepth  = true;
             varjoManager.depthTesting = true;
             depthEstimation           = VarjoPluginMR.EnableDepthEstimation();
         }
         else
         {
             varjoManager.submitDepth  = originalSubmitDepthValue;
             varjoManager.depthTesting = false;
             VarjoPluginMR.DisableDepthEstimation();
         }
         depthEstimationEnabled = depthEstimation;
     }
 }