예제 #1
0
        private void SwapInvaderSprites()
        {
            var invaders = _gameStateProvider.Current.InvaderViews;

            for (int i = 0; i < invaders.Length; i++)
            {
                var invader = invaders[i];
                if (invader.IsActive())
                {
                    invader.SwapSprite();
                    if (r.NextDouble() < _firingProbability)
                    {
                        _generateMissile.Generate(invader.GetCurrentPosition(), Vector3.down * 300, MissileType.Invader);
                    }
                }
            }
        }
예제 #2
0
        private void FireMissile()
        {
            var firingTransform = _playerView.GetFiringTransform();

            _generateMissile.Generate(firingTransform.position, firingTransform.up * firingSpeed, MissileType.Player);
        }