protected void Shoot() { if (HasWeapons) { CurrentWeapon.Shoot(_body.Position + Vector2.Normalize(_locationToFace - _body.Position) * (EntitySize / 1.5f), _locationToFace - _body.Position); } }
public void Shoot() { if (IsDead) { return; } CurrentWeapon.Shoot(); }
public void Shoot(long commandId = 0) { if (CurrentWeapon != null) { //calculate start point // Plus 1.5 step as Weapon gunpoint var startPosition = Direction.MovePoint( Shape.Position, Shape.MaxDimension * 1.5); CurrentWeapon.Shoot(startPosition, Direction, this.Id, commandId); } }
// Управление кораблем игрока public void Update() { if (!Enable) { return; } if (Input.GetKey(InputKeyCodes.Left)) { if (rigidbody.transform.position.x > Extensions.OrthographicBounds().min.x + offset) { rigidbody.AddForce(Vector3.left * Time.deltaTime * CurrentMoveingSpeed); } else { rigidbody.velocity = Vector2.zero; } } if (Input.GetKey(InputKeyCodes.Right)) { if (rigidbody.transform.position.x < Extensions.OrthographicBounds().max.x - offset) { rigidbody.AddForce(Vector3.right * Time.deltaTime * CurrentMoveingSpeed); } else { rigidbody.velocity = Vector2.zero; } } if (Input.GetKey(InputKeyCodes.StartGame) && Time.time > nextFireTime) { nextFireTime = Time.time + CurrentShootingSpeed; CurrentWeapon.Shoot(statMultiplier.WeaponDamageMultiplier); } }
void Shoot() { CurrentWeapon.Shoot(); WeaponsShotSFX = CurrentWeapon.shootSFX; audioSource.PlayOneShot(WeaponsShotSFX); }