private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { _jumping.Jump(); } var input = Input.GetAxis("Horizontal"); if (Mathf.Abs(input) > 0.0f) { _movement.Move(input); } if (Input.GetMouseButtonDown(0)) { _gunManager.Fire(); } var mousePosition = Input.mousePosition; mousePosition.z = -Camera.main.transform.position.z; mousePosition = Camera.main.ScreenToWorldPoint(mousePosition); mousePosition = mousePosition - transform.position; _gunManager.PointInDirection(mousePosition); }
private void FixedUpdate() { if (_currentZombieState == ZombieStates.Approaching || _currentZombieState == ZombieStates.Jumping) { if (_currentZombieState == ZombieStates.Jumping && _jumping.IsGrounded) { _jumping.Jump(); } _movement.Move(_direction); } }