private void Update() { if (!setupScreenActive) { if (Input.GetKeyDown(KeyCode.C) || startWithConfig) { setupScreenActive = true; DisableInteractions?.Invoke(); // display default autoconfig screen configCanvas.SetActive(true); startWithConfig = false; ChangeState(ConfigState.WELCOME); OnConfigActive?.Invoke(); isActive = true; } } else { if (closeConfig || manualConfigKeyEntered == "C" || Input.GetKeyDown(KeyCode.Escape)) { if (currentState == ConfigState.WELCOME) { setupScreenActive = false; EnableInteractions?.Invoke(); SingleHandManager.Instance.useTrackingTransform = true; configCanvas.SetActive(false); OnConfigInactive?.Invoke(); closeConfig = false; isActive = false; } else { ChangeState(ConfigState.WELCOME); } } switch (currentState) { case ConfigState.WELCOME: RunWelcomeScreen(); break; case ConfigState.LEAP_MOUNT: RunLeapMount(); break; case ConfigState.AUTO_OR_MANUAL: RunAutoOrManual(); break; case ConfigState.AUTO: RunAutoConfig(); break; case ConfigState.AUTO_COMPLETE: RunAutoConfigComplete(); break; case ConfigState.MANUAL: RunManualConfig(); break; case ConfigState.SETTINGS: RunSettings(); break; case ConfigState.FILE_SCREEN: RunFileScreen(); break; case ConfigState.TEST_CALIBRATION: RunCalibrationTest(); break; } } manualConfigKeyEntered = ""; }
public void RefreshConfigInactive() { OnConfigActive?.Invoke(); OnConfigInactive?.Invoke(); }