private void OnTriggerEnter(Collider other) { //Debug.Log(this.id); if (other.tag == "Player") { if (id == 0) { _waterSound._canPlaySound = true; _rainSound._canPlaySound = true; _waterSound.PlayWaterSound(); _rainSound.PlaySound(); } if (id == 1) { _waterSound._canPlaySound = false; _rainSound._canPlaySound = false; _waterSound.StopWaterSound(); _rainSound.StopSound(); } } }
void Update() { if (Input.GetKeyDown(KeyCode.Escape) && !isGOScreen) { _isPaused = !_isPaused; if (_cutScene.inCutScene && _isPaused) { _cutScene.PauseCutScene(); } else if (_cutScene.inCutScene && !_isPaused) { _cutScene.ResumeCutScene(); } if (_juliaCutScene.inCutScene && _isPaused) { _juliaCutScene.PauseCutScene(); } else if (_juliaCutScene.inCutScene && !_isPaused) { _juliaCutScene.ResumeCutScene(); } } if (_isPaused) { if (check) { rainSound.StopSound(); _waterSound.StopWaterSound(); check = !check; } _panelPause.SetActive(true); _mainCam.enabled = false; _playerCtrl.inGamePlay = false; _playerAttack.enabled = false; if (!_cutScene.inCutScene && !_juliaCutScene.inCutScene) { _hud.gameObject.SetActive(false); } _image.SetActive(false); Cursor.visible = true; Cursor.lockState = CursorLockMode.None; Time.timeScale = 0; } else { if (_cutScene.inCutScene) { _cutScene.ResumeCutScene(); } if (!check) { rainSound.PlaySound(); _waterSound.PlayWaterSound(); check = !check; } _mainCam.enabled = true; _playerAttack.enabled = true; _playerCtrl.inGamePlay = true; _panelPause.SetActive(false); if (!_cutScene.inCutScene && !_juliaCutScene.inCutScene) { _hud.gameObject.SetActive(true); } _image.SetActive(true); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; Time.timeScale = 1; } }