Ejemplo n.º 1
0
 public void Initialize(IUserInput userInput,
                        [Inject(Id = Identifiers.PlayerProjectile)]
                        Projectile.Pool projectilesPool,
                        [Inject(Id = Identifiers.PlayerExplosion)]
                        Explosion.Pool explosionsPool)
 {
     _userInput       = userInput;
     _projectilesPool = projectilesPool;
     _explosionsPool  = explosionsPool;
 }
Ejemplo n.º 2
0
 public void Initialize(PlayerShip playerShip,
                        [Inject(Id = Identifiers.EnemyProjectile)]
                        Projectile.Pool projectilesPool,
                        [Inject(Id = Identifiers.EnemyExplosion)]
                        Explosion.Pool explosionsPool)
 {
     _playerShip         = playerShip;
     _projectilesPool    = projectilesPool;
     _explosionsPool     = explosionsPool;
     _damageable.GotHit += OnHit;
 }
        public void Setup(Transform playerShipTransform, Projectile.Pool projectilesPool, int shotsInBurst, float burstDelay,
                          float shotsDelay, float projectileSpeed)
        {
            _playerShipTransform = playerShipTransform;
            _projectilesPool     = projectilesPool;
            _shotsInBurst        = shotsInBurst;
            _burstDelay          = burstDelay;
            _shotsDelay          = shotsDelay;
            _projectileSpeed     = projectileSpeed;

            _timeToNextShot = Random.Range(0, burstDelay);
            _firedInBurst   = 0;
        }