private void Start()
        {
            VisionSDK sdk = GameObject.FindObjectOfType <VisionSDK>();

            qualityController = new QualityController(sdk);

            CurrentQuality = qualityController.GetQuality();
            UpdateQualityBar((int)CurrentQuality);
        }
Esempio n. 2
0
        public Quality GetQuality()
        {
            QualityController qualityController = new QualityController(GameObject.FindObjectOfType <VisionSDK>());

            return(qualityController.GetQuality());
        }
        private void Setup()
        {
            DontDestroyOnLoad(InSceneContainerSounds);

            // adding listeners
            LanguageSelectionEvents.OnLanguageSelected        += OnLanguageSelected;
            LanguageSelectionEvents.OnLanguageSelectionClosed += OnLanguageSelectionClosed;

            // playing background music
            AudioEvent.Play(AudioEventName.Ftue.Stereo.BackgroundMusicStart, gameObject, 1.0f);

            //show language selection if not set already
            PlayerPrefsStorage prefsStorage = new PlayerPrefsStorage(Game.ForceVision);

            if (prefsStorage.PrefKeyExists(Localizer.LanguagePrefKey) == true)
            {
                LanguageSelection.SetActive(false);
                TitleScreen.SetActive(true);
            }
            else
            {
                LanguageSelection.SetActive(true);
                TitleScreen.SetActive(false);
            }

            // getting bluetooth, listening for bluetooth state changes
            Container.NativeSettings.GetBluetoothState("StereoSetupCanvas");

            // getting brightness level, listening brightness level changes
            Container.NativeSettings.SetBrightness(MaxBrightness);

            Controller = new ControllerPeripheral(VisionSDK.ControllerName);
            Sdk.Connections.AddPeripheral(Controller);

            Sdk.Connections.OnPeripheralStateChange += OnPeripheralStateChange;

            resizeAlignFTUE.Sdk = Sdk;
            resizeAlignRTUE.Sdk = Sdk;

            StereoSetupFtueController    ftue = MainCanvas.GetComponentInChildren <StereoSetupFtueController>(true);
            StereoSetupNonFtueController rtue = MainCanvas.GetComponentInChildren <StereoSetupNonFtueController>(true);

            ftue.Sdk = Sdk;
            rtue.Sdk = Sdk;

            // starting device check timer
            deviceCheckTime = Time.time + deviceCheckInterval;

            // adding listeners for title screen related events
            TitleScreenEvents.OnMenuSelected += OnMenuSelected;

                        #if !RC_BUILD
            // adding listener for touch down time reached
            TouchDownTimer.OnTouchDownTimeReached += OnTouchDownTimeReached;
                        #endif

            QualityController qualityController = new QualityController(Sdk);
            qualityController.ApplyQuality();

                        #if UNITY_EDITOR
            currentVolume = Mathf.Floor(UnityEngine.Random.Range(0, 1f) * 10) / 10f;
                        #else
            Log.Debug("Call LoadContent from Start");
            LoadContent();
            currentVolume = container.NativeSettings.GetVolume();
                        #endif

            // 3D sound setting
            for (int i = 0; i < SpatializationToggles.Length; i++)
            {
                SpatializationToggles[i].isOn = container.UseSpatialization();
            }

            // If the phone is not supported, profile selection is always on
            if (!JCSettingsManager.HasDeviceProfile)
            {
                ProfileSelectionToggle.isOn         = true;
                ProfileSelectionToggle.interactable = false;
            }
            else
            {
                // profile selection override setting
                ProfileSelectionToggle.isOn = ContainerAPI.UseProfileSelection();
            }
            SetPofilesSelectableInFTUEAndRTUE(ProfileSelectionToggle.isOn);

                        #if IS_DEMO_BUILD
            ContainerAPI.LoadDemoOptions();

            // make demo options visible and set UI state
            DemoOptions.SetActive(true);
            OptionsSpacer.SetActive(false);
            AllProgressionUnlockedToggle.isOn = ContainerAPI.AllProgressionUnlocked;
            GoProModeToggle.isOn = Disney.Vision.Internal.XimmerseTracker.UseGoProCameras;
                        #endif

            // this controller is common to both ftue and rtue so lets log the OTA version here (new ota data should already be downloaded)
            string otaVersion = DownloadController.GetManifestVersion()[0];

            Analytics.LogAction(new ActionAnalytics(SystemInfo.deviceModel,
                                                    "StereoSetupStart.ota" + otaVersion + (JCSettingsManager.HasDeviceProfile ? ".supported_device" : ".unsupported_device"),
                                                    -1,
                                                    ContainerAPI.UseProfileSelection().ToString()
                                                    ));
            SetLanguage();

            if (CreditsEndMessage != null)
            {
                CreditsEndMessage.SetActive(ContainerAPI.IsMedalUnlocked(MedalType.Mastery));
            }

            // Check what device the app is running on and adjust the UI accordingly
            var device = Sdk.Settings.CurrentDevice;

            if (device != null)
            {
                switch (device.Name)
                {
                case "iPhone X":
                    Scaler.matchWidthOrHeight = 1f;
                    break;
                }
            }
        }