Exemple #1
0
 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);
     }
 }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
 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;
     }
 }
Exemple #4
0
 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);
     }
 }
Exemple #5
0
    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);
        }
    }
Exemple #6
0
    private void Start()
    {
        _currentState = GameManager.Instance.CurrentState;

        EventManager.Instance.OnPlayingStateChanged.AddListener(ChangePPVWeight);
    }