public void Construct(IShotPoint shotPoint, float spread, IDamage damage, [NotNull][Inject(Id = "Self")] Rigidbody selfRigidbody, [NotNull] ShotParticle.Factory shotParticleFactory, [NotNull] SimpleDamage.Factory simpleDamageFactory) { //Initialize _rigidbody = GetComponent <Rigidbody>(); _shotParticleFactory = shotParticleFactory; _simpleDamageFactory = simpleDamageFactory; Spread = spread; transform.position = shotPoint.Position; //Logic Direction = Quaternion.AngleAxis(Random.Range(-spread / 2, spread / 2), Vector3.up) * shotPoint.Forward; SubscribeToStreams(damage); }
protected void Shot(IShotPoint shotPoint, IDamage damage) { _shotFactory.Create(shotPoint, _spread, damage); }
public ShotPoint(Transform parrent, IShotPoint shotPoint) { _parrent = parrent; _shotPoint = shotPoint.ShotPoint; }