예제 #1
0
        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);
        }
예제 #2
0
 protected void Shot(IShotPoint shotPoint, IDamage damage)
 {
     _shotFactory.Create(shotPoint, _spread, damage);
 }
예제 #3
0
 public ShotPoint(Transform parrent, IShotPoint shotPoint)
 {
     _parrent   = parrent;
     _shotPoint = shotPoint.ShotPoint;
 }