public void Shoot() { if (!CanShoot()) { return; } _weapon.CurrentClipSize--; _nextTimetoFire = 0f; Vector3 dir = Target.transform.position - transform.position; GameObject clone = Instantiate(_weapon.ProjectilePrefab, _weapon.ShootPosition.position, Quaternion.LookRotation(dir)); EnemyStandardProjectile bullet = clone.GetComponent <EnemyStandardProjectile>(); bullet.Direction = dir; bullet.Weapon = _weapon; }
public LifeTimeProjectile(EnemyStandardProjectile projectileStandard, float range) { ProjectileEnemyStandard = projectileStandard; ReamingLifeTime = range; }
public void AddItemToDestruction(EnemyStandardProjectile projectileStandard) { _projectiles.Add(new LifeTimeProjectile(projectileStandard, projectileStandard.Range)); }