public void OnCollisionEnter2D(Collision2D collision) { NotifyObservers("UpdateScore"); Instantiate(RouletteWheelSelection.GetRandomByWeight(posiblesPowerUPS, weights), this.transform.position, this.transform.rotation); Instantiate(explosion, this.transform.position, this.transform.rotation); _enemyPool.ReturnEnemyToPool(this); }
public void OnCollisionEnter2D(Collision2D collision) { Instantiate(explosion, this.transform.position, this.transform.rotation); Instantiate(RouletteWheelSelection.GetRandomByWeight(posiblesPowerUPS, weights), this.transform.position, this.transform.rotation); StartCoroutine(DestroyHeroBulletOnCollision(1f)); }