Пример #1
0
        static void CheckVuforiaConfigurationForEyewearSettings(BuildTargetGroup buildTargetGroup)
        {
            VuforiaConfiguration vuforiaConfiguration = VuforiaConfigurationEditor.LoadConfigurationObject();

            DigitalEyewearARController.EyewearType             eyewearType   = vuforiaConfiguration.DigitalEyewear.EyewearType;
            DigitalEyewearARController.SeeThroughConfiguration opticalConfig = vuforiaConfiguration.DigitalEyewear.SeeThroughConfiguration;

            switch (buildTargetGroup)
            {
            case BuildTargetGroup.Android:
                if (eyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough ||
                    (eyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough &&
                     opticalConfig == DigitalEyewearARController.SeeThroughConfiguration.Vuforia))
                {
                    EnableVR(buildTargetGroup);
                }
                break;

            case BuildTargetGroup.iOS:
                if (eyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough)
                {
                    EnableVR(buildTargetGroup);
                }
                break;

            case BuildTargetGroup.WSA:
                if (eyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough &&
                    opticalConfig == DigitalEyewearARController.SeeThroughConfiguration.HoloLens)
                {
                    EnableVR(buildTargetGroup);
                }
                break;
            }
        }
 protected override void Awake()
 {
     VuforiaAbstractConfiguration.DigitalEyewearConfiguration digitalEyewear = VuforiaAbstractConfiguration.Instance.DigitalEyewear;
     this.mCameraOffset             = digitalEyewear.CameraOffset;
     this.mDistortionRenderingMode  = digitalEyewear.DistortionRenderingMode;
     this.mDistortionRenderingLayer = digitalEyewear.DistortionRenderingLayer;
     this.mEyewearType             = digitalEyewear.EyewearType;
     this.mStereoFramework         = digitalEyewear.StereoFramework;
     this.mSeeThroughConfiguration = digitalEyewear.SeeThroughConfiguration;
     this.mViewerName         = digitalEyewear.ViewerName;
     this.mViewerManufacturer = digitalEyewear.ViewerManufacturer;
     this.mUseCustomViewer    = digitalEyewear.UseCustomViewer;
     this.mCustomViewer       = digitalEyewear.CustomViewer;
     if (this.mEyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough && this.mStereoFramework != DigitalEyewearARController.StereoFramework.Vuforia)
     {
         this.mCentralAnchorPoint = base.VuforiaBehaviour.CentralAnchorPoint;
         this.mParentAnchorPoint  = base.VuforiaBehaviour.ParentAnchorPoint;
         this.mPrimaryCamera      = base.VuforiaBehaviour.PrimaryCamera;
         this.mSecondaryCamera    = base.VuforiaBehaviour.SecondaryCamera;
     }
     if (this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough && this.mSeeThroughConfiguration == DigitalEyewearARController.SeeThroughConfiguration.HoloLens)
     {
         this.mCentralAnchorPoint = base.VuforiaBehaviour.CentralAnchorPoint;
     }
     this.mVuforiaBehaviour = VuforiaARController.Instance;
     this.mVuforiaBehaviour.RegisterVuforiaInitializedCallback(new Action(this.OnVuforiaInitialized));
     this.mVuforiaBehaviour.RegisterVuforiaStartedCallback(new Action(this.OnVuforiaStarted));
     if (VuforiaRuntimeUtilities.IsPlayMode() && this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough)
     {
         Device.SetPlayModeEyewearDevice();
         return;
     }
     Device.UnsetDevice();
 }
 public void SetSeeThroughConfiguration(DigitalEyewearARController.SeeThroughConfiguration config)
 {
     this.mSeeThroughConfiguration = config;
 }