private void ChangeCameraOffset(GameManager.PlayingState state) { if (state == GameManager.PlayingState.Smarmotting) { _camera.DOMove(_smarmottingCameraOffset.position, _cameraTweenDuration); _camera.DORotate(_smarmottingCameraOffset.rotation.eulerAngles, _cameraTweenDuration); } else if (state == GameManager.PlayingState.Running) { _camera.DOMove(_runningCameraPositionOffset + _player.transform.position, _cameraTweenDuration); _camera.DORotate(_runningCameraRotationOffset.eulerAngles, _cameraTweenDuration); } }
private void ChangePPVWeight(GameManager.PlayingState state) { if (state == GameManager.PlayingState.Running) { DOTween.To(() => _farPPV.weight, value => _farPPV.weight = value, 1f, 0.5f); DOTween.To(() => _nearPPV.weight, value => _nearPPV.weight = value, 0f, 0.5f); } else if (state == GameManager.PlayingState.Dialoguing || state == GameManager.PlayingState.Smarmotting) { DOTween.To(() => _farPPV.weight, value => _farPPV.weight = value, 0f, 0.5f); DOTween.To(() => _nearPPV.weight, value => _nearPPV.weight = value, 1f, 0.5f); } }
private void UpdateUI(GameManager.PlayingState state) { if (state == GameManager.PlayingState.Dialoguing) { _isDialoguing = true; EventManager.Instance.OnButtonPressed.AddListener(BlinkButton); } else if (_isDialoguing) { EventManager.Instance.OnButtonPressed.RemoveListener(BlinkButton); _isDialoguing = false; } }
private void PopUp(GameManager.PlayingState state) { if (state == GameManager.PlayingState.Lost) { _text.text = "HAI SMARMOTTATO"; _endPanel.SetActive(true); } else if (state == GameManager.PlayingState.Won) { _text.text = "YOU WON!"; _endPanel.SetActive(true); } }
private void QuitDialog(GameManager.PlayingState playingState) { if (playingState == GameManager.PlayingState.Smarmotting) { switch (_dialogState) { case DialogState.Answering: EventManager.Instance.OnButtonPressed.RemoveListener(CheckAnswer); break; default: break; } _dialogPanel.gameObject.SetActive(false); } }
private void Start() { _currentState = GameManager.Instance.CurrentState; EventManager.Instance.OnPlayingStateChanged.AddListener(ChangePPVWeight); }