예제 #1
0
        private void Update()
        {
            // Check is game is over
            if (_gameController.HasGameEnded())
            {
                return;
            }

            if (_playerNearby && !_interactionComplete)
            {
                _promptController.ShowPrompt(triggerKey, actionName);
                _promptShown = true;
            }
            else if (_promptShown)
            {
                _promptController.HidePrompt();
                _promptShown = false;
            }

            if (Input.GetKey(triggerKey) && _playerNearby && !_interactionComplete)
            {
                playerAnimation.SetOnAnimator(_playerAnim);
                interaction.Invoke();
                _interactionComplete = true;
                _promptController.HidePrompt();
                _promptShown = false;
            }
        }
예제 #2
0
 protected void Return(object value = null)
 {
     gameObject.SetActive(false);
     PromptController.HidePrompt();
     onCompleted(value);
 }