private void Update() { var horizontal = Input.GetAxis("Horizontal"); var vertical = Input.GetAxis("Vertical"); if (vertical > 0) { var teleporter = FindTeleporter(); if (teleporter != null) { teleporter.Teleport(this.gameObject); } } if (!_jump) { _jump = Input.GetButtonDown("Jump"); } if (Input.GetButtonDown("Interact")) { var interactionTrigger = interactionFinder.GetInteractionTrigger(); if (interactionTrigger != null) { interactionTrigger.Interact(this.gameObject); } } _characterController.Move(horizontal, vertical, _jump); _jump = false; if (Input.GetButtonDown("Fire1")) { _characterController.LightAttack(); } }
public void MoveInDirection(Direction direction) { _platformerController.Move(direction == Direction.Left ? -1 : 1, 0, false); }