Пример #1
0
 public AsteroidController(AsteroidData _asteroid, AsteroidView _asteroidView)
 {
     this.asteroid     = _asteroid;
     this.asteroidView = _asteroidView;
     asteroidView.SetDamage(asteroid.Damage);
     resetHP = _asteroid.HP;
 }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     // столкновение с астероидом
     if (collision.tag == "Asteroid")
     {
         AsteroidView asteroid = collision.GetComponent <AsteroidView>();
         HpEvent?.Invoke(asteroid.GetAsteroidDamage());
         asteroid.KillAsteroid();
     }
 }