//on mobile devices I will check attack input inside private void CheckPlayerInput() for sake of performance private void CheckAttackInput() { if (Input.GetButton("Fire1") && Time.time > c_timeToAttack) { c_playerWeaponManager.Attack(); c_timeToAttack = Time.time + c_attackCooldown; } }
void AttackWhileIdle() { if (controller.isGrounded) { normalizedHorizontalSpeed = 0; animator.SetBool("attack", true); animator.SetBool("run", false); weaponManager.Attack(); } attack = false; }
private void doAttack() { if (weapon != null) { //anim.SetTrigger ("Firing"); weapon.Attack(true); weapon.shootingRate = maxRate; } }
public bool Attack() { if (weapon.Attack()) { anim.SetTrigger("Attack"); return(true); } return(false); }
// Update is called once per frame void Update() { currentWeapon = weaponManager.GetCurrentWeapon(); if (Input.GetButtonDown("Fire1")) { Attack(); weaponManager.Attack(); } }
void CheckForAttack() { if (Time.time > nextAttack) { if (inputAttack) { weaponManager.Attack(); animState.attacking = true; inputAttack = false; } else { animState.attacking = false; } nextAttack = Time.time + multiClickBuffer; } }
public void HandleWeapons() { hitButton = input.GetButtonInput(Constants.HIT_BUTTON); pickup = input.GetButtonInput(Constants.PICKUP_WEAPON); if (hitButton) { weaponManager.Attack(); } if (pickup) { weaponManager.PickUp(); } if (weaponManager.updateUI) { hudController.OnGround = weaponManager.PickupWeapon ? weaponManager.PickupWeapon.pickup : null; } }
void Update() { if (Input.GetKeyDown(KeyCode.Q)) { weaponManager.SwitchWeapon(); } if (Input.GetKey(KeyCode.Space)) { isHoldAttack = true; } else { weaponManager.ResetAttack(); isHoldAttack = false; } if (isHoldAttack && canShoot) { weaponManager.Attack(); } }
public void _1_Attack_Return_True_If_Exit_After_Attacking() { weapon.Build(); target.Build(weapon, TypeOfWeapon.Fist); Assert.IsTrue(target.Attack()); }