public void Show() { CalibrationUI.SetActive(true); ForceScreenOrientation.SetScreenOrientation(ScreenOrientation.Portrait); ShowCalibrationWindow(); PitchPlatformerManager.Instance.PauseGame(); }
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(); } }
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(); }