Exemplo n.º 1
0
    public override void Die(bool scorePoints)
    {
        burstWeapon.SpawnBullets(transform.position);

        if (scorePoints)
        {
            AudioManager.PlaySFX(deathSound);
        }

        pool.ReturnObject(this.gameObject);
    }
Exemplo n.º 2
0
        public void Trigger(Vector2 pos)
        {
            _point.BakePosition(pos);
            Vector2 direction = _directionToPlayer ? (_point.GetPosition() - Program.Player.Position).Normalized : _direction;

            direction = direction.Rotate(_rotation);

            if (_directionToPlayer)
            {
                direction.y = -direction.y;
                direction  *= _direction;
            }

            _pattern.SpawnBullets <Bullet>(_owner, _correctY, _point.GetPosition(), direction, _pool, _damage, _bulletSize, _speedModifier, _lifeTime, _order, _directionLerp);
            _complete = true;
        }
        public override void Despawn(bool silent)
        {
            if (!IsAlive)
            {
                return;
            }
            for (int i = 0; i < _bullets.Length; i++)
            {
                _bullets[i].Despawn(silent);
            }
            _bullets = new Bullet[0];

            if (!silent)
            {
                _patternToUse.SpawnBullets <Bullet>(_owner, true, Position, Direction, _pooler, (int)(Damage * 0.25f), 0.05f, 1.5f, _lifeTime * 0.25f, renderingOffset + 10, 0.575f);
            }
            base.Despawn(silent);
        }