public void Update() { if (canvas.worldCamera == null) { TrinusUI.assignUICamera(canvas, trinusProcessor.getUICamera()); if (trinusProcessor.shouldScaleUI()) { transform.localScale = new Vector3(transform.localScale.x / 2, transform.localScale.y, transform.localScale.z); } } if (Input.GetButtonDown("Cancel")) //in game mode, pause by pressing ESC { switch (state) { case STATE.GAME: pause(true); break; case STATE.PAUSE: pause(false); break; } } //when Trinus is running in VR mode, standard cursor won't work so we enable and update Trinus cursor if (state == STATE.PAUSE) { TrinusUI.updateTrinusCursor(); } }
// Update is called once per frame void Update() { if (canvas != null && canvas.worldCamera == null) { TrinusUI.assignUICamera(canvas, trinusProcessor.getUICamera()); } if (Input.GetButtonDown("Cancel")) //in game mode, pause by pressing ESC //if (trinusUI.getCurrentPage() == TrinusUI.UI_PAGE.GAME) { switch (trinusUI.getCurrentPage()) { case TrinusUI.UI_PAGE.GAME: Time.timeScale = 0; trinusUI.openSettings(); break; case TrinusUI.UI_PAGE.SETTINGS: trinusEventSettingsFinished(); break; case TrinusUI.UI_PAGE.CONNECTION_WAIT: trinusUI.restartConnection(); break; } } }
// Update is called once per frame void Update() { if (canvas.worldCamera == null) { TrinusUI.assignUICamera(canvas, trinusProcessor.getUICamera()); } if (Input.GetButtonDown("Cancel")) //in game mode, pause by pressing ESC { quit(); } }