protected override void PlaceProjectiles()
    {
        IProjectile projectileLeft = ProjectilePool.TakeProjectile(Config.Category);
        projectileLeft.Reset(LeftPosition.position, transform.up, LayerMask.NameToLayer(Arena.PlayerProjectileLayer));
        IProjectile projectileRight = ProjectilePool.TakeProjectile(Config.Category);
        projectileRight.Reset(RightPosition.position, transform.up, LayerMask.NameToLayer(Arena.PlayerProjectileLayer));

    }
    private void FireTick()
    {
        _fireDelay -= Time.deltaTime;
        if (_fireDelay < 0)
        {
            IProjectile projectile = _projectilePool.TakeProjectile(Config.Projectile);
            projectile.Reset(transform.position, -transform.up, LayerMask.NameToLayer(Arena.EnemyProjectileLayer));

            _fireDelay = 1f / Config.FireRate;
        }
    }
Beispiel #3
0
    private IEnumerator SpawnProjectile()
    {
        while (true)
        {
            if (!HasFire)
            {
                yield break;
            }

            _projectilePool.TakeProjectile();
            yield return(new WaitForSeconds(_fireВelay));
        }
    }
    protected virtual void PlaceProjectiles()
    {
        IProjectile projectile = ProjectilePool.TakeProjectile(Config.Category);

        projectile.Reset(transform.position, transform.up, LayerMask.NameToLayer(Arena.PlayerProjectileLayer));
    }