Beispiel #1
0
 private void ProcessAttack()
 {
     HorizontalAxisInput = 0;
     LookDirection       = _target.position;
     OnAttackAction?.Invoke();
     _lastAttack = Time.time;
 }
Beispiel #2
0
        private void Awake()
        {
            _playerControls = new PlayerControls();

            _playerControls.Player.Move.performed += ctx => HorizontalAxisInput = ctx.ReadValue <float>();

            _playerControls.Player.Jump.performed += ctx => OnJumpAction?.Invoke();

            _playerControls.Player.AimDirection.performed += ctx => LookDirection = Camera.main.ScreenToWorldPoint(ctx.ReadValue <Vector2>());

            _playerControls.Player.Shoot.performed += ctx => OnAttackAction?.Invoke();
        }
 private void OnAttackActionInvoker() => OnAttackAction?.Invoke();