private void Jump() { if (_canJump && Input.GetKeyDown(KeyCode.Space)) { _player.Jump(); } }
private void Awake() { _dialogueUI = FindObjectOfType <DialogueUI>(); _dialogueRunner = FindObjectOfType <DialogueRunner>(); _player = GetComponent <PlayerController>(); _controls = new Controls(); _controls.player.jump.performed += ctx => _player.Jump(); [email protected] += ctx => _dialogueUI.MarkLineComplete(); _controls.game.exit.performed += ctx => _dialogueRunner.StartDialogue("Quit"); _dialogueRunner.AddCommandHandler( "Quit", Quit ); }