コード例 #1
0
 private void Jump()
 {
     if (_canJump && Input.GetKeyDown(KeyCode.Space))
     {
         _player.Jump();
     }
 }
コード例 #2
0
        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
                );
        }