コード例 #1
0
        private void AddShootingComponent()
        {
            var shootingParameters = new ShootingParameters(playerConfiguration.ProjectileVelocity,
                                                            playerConfiguration.MinShootingInterval, projectileSpawnPosition, ProjectileDirection.Up,
                                                            playerConfiguration.ProjectileLifetime);

            shootingomponent = new ShootingComponent(shootingParameters, signalBus);
        }
コード例 #2
0
ファイル: PlayerView.cs プロジェクト: Pe1m4n/TheNightIsDark
        private void Awake()
        {
            Physics2D.autoSimulation = false;
            var rigidBody = GetComponent <Rigidbody2D>();

            _rotationComponent = new RotationComponent(rigidBody);
            _audioComponent    = new AudioComponent(GetComponent <AudioSource>());
            _shootingComponent = new ShootingComponent(_bulletFactory, transform, _audioComponent, _playerState, _flashAnimation);
        }
コード例 #3
0
        private void AddShootingComponent()
        {
            var enemyConfiguration = enemiesConfiguration.GetEnemyConfiguration(type);
            var shootingParameters = new ShootingParameters(enemyConfiguration.ProjectileVelocity,
                                                            enemyConfiguration.MinShootingInterval, projectileSpawnPosition, ProjectileDirection.Down,
                                                            enemyConfiguration.ProjectileLifetime);

            shootingomponent = new ShootingComponent(shootingParameters, signalBus);
        }
コード例 #4
0
 // Unity event functions section.
 void Awake()
 {
     lerpAnimations          = GetComponent <LerpComponent>();
     shootComponent          = GetComponent <ShootingComponent>();
     moveComponent           = GetComponent <MovementComponent>();
     moveComponent.MoveSpeed = baseSpeed;
     polyCollider            = GetComponent <PolygonCollider2D>();
     swapper     = GetComponent <ColorSwapper>();
     mainActions = new MainActions();
     mainActions.Player.SetCallbacks(this);
     EventList.enemyDeath         += Player_OnEnemyDeath;
     EventList.grubCollect        += Player_OnGrubCollect;
     HelperMethods.playerTransform = transform;
 }
コード例 #5
0
ファイル: Movement.cs プロジェクト: dchmak/Split-Screen
    private void Start()
    {
        horizontalAxis = mode.ToString() + " Horizontal";
        verticalAxis   = mode.ToString() + " Vertical";
        blinkButton    = mode.ToString() + " Blink";
        fireButton     = mode.ToString() + " Fire";

        blink      = false;
        blinkTimer = 0f;

        shaker  = GetComponentInChildren <CameraShake>();
        shooter = GetComponent <ShootingComponent>();

        gameManager = GameManager.instance;

        health = GetComponent <HealthComponent>();
    }
コード例 #6
0
 private void Awake()
 {
     movement = GetComponent <Movement>();
     shoot    = GetComponent <ShootingComponent>();
     health   = GetComponent <HealthComponent>();
 }
コード例 #7
0
 void Start()
 {
     shootingComp = GetComponent <ShootingComponent>();
 }
コード例 #8
0
 public ReloadingState(ShootingComponent component, float minShotInterval) : base(component)
 {
     this.minShotInterval = minShotInterval;
 }
コード例 #9
0
 protected AbstractShootingState(ShootingComponent component)
 {
     this.component = component;
 }
コード例 #10
0
 public FiringState(ShootingComponent component, SignalBus signalBus, ShootingParameters parameters) : base(component)
 {
     this.signalBus  = signalBus;
     this.parameters = parameters;
 }
コード例 #11
0
 public IdleState(ShootingComponent shootingComponent) : base(shootingComponent)
 {
 }