private void AddShootingComponent() { var shootingParameters = new ShootingParameters(playerConfiguration.ProjectileVelocity, playerConfiguration.MinShootingInterval, projectileSpawnPosition, ProjectileDirection.Up, playerConfiguration.ProjectileLifetime); shootingomponent = new ShootingComponent(shootingParameters, signalBus); }
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); }
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); }
// 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; }
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>(); }
private void Awake() { movement = GetComponent <Movement>(); shoot = GetComponent <ShootingComponent>(); health = GetComponent <HealthComponent>(); }
void Start() { shootingComp = GetComponent <ShootingComponent>(); }
public ReloadingState(ShootingComponent component, float minShotInterval) : base(component) { this.minShotInterval = minShotInterval; }
protected AbstractShootingState(ShootingComponent component) { this.component = component; }
public FiringState(ShootingComponent component, SignalBus signalBus, ShootingParameters parameters) : base(component) { this.signalBus = signalBus; this.parameters = parameters; }
public IdleState(ShootingComponent shootingComponent) : base(shootingComponent) { }