예제 #1
0
 public void Show()
 {
     CalibrationUI.SetActive(true);
     ForceScreenOrientation.SetScreenOrientation(ScreenOrientation.Portrait);
     ShowCalibrationWindow();
     PitchPlatformerManager.Instance.PauseGame();
 }
예제 #2
0
        void Start()
        {
            ForceScreenOrientation.SetScreenOrientation(ScreenOrientation.Portrait);

            m_PitchTracker            = new PitchTracker();
            m_PitchTracker.SampleRate = AudioSettings.outputSampleRate;

            m_CalibratedLowPitch  = m_LowPitchReference;
            m_CalibratedHighPitch = m_HighPitchReference;

            CalibrateHighPitchButton.onClick.AddListener(CalibrateHighPitch);
            CalibrateLowPitchButton.onClick.AddListener(CalibrateLowPitch);

            ShowCalibrationTestButton.gameObject.SetActive(false); // at the start the user has not calibrated his pitch yet, so he should not be able to test it

            ShowCalibrationTestButton.onClick.AddListener(ShowCalibrationTestWindow);
            ShowCalibrationButton.onClick.AddListener(ShowCalibrationWindow);

            FinishCalibrationButton.onClick.AddListener(SaveCalibration);

            if (LoadCalibration())
            {
                Hide();
            }
            else
            {
                Show();
            }
        }
예제 #3
0
 public void Hide()
 {
     CalibrationUI.SetActive(false);
     ForceScreenOrientation.ResetScreenOrientation(); // the calibration should run in portrait mode, reset this to previous screen orientation when finished
     PitchPlatformerManager.Instance.ResumeGame();
 }