private IEnumerator DoDeath(GenericItem death) { yield return(this.level.StartCoroutine(death.instance.GetComponent <Dissolve>().DoDissolve(3f))); death.Return(); death.instance.GetComponent <Dissolve>().Set(0f); }
private IEnumerator SpawnEnemyRoutine(GenericItem portal, Enemy enemy, Vector2 location) { yield return(new WaitForSeconds(0.875f)); GenericItem silhouette = this.silhouettes.Pop(location); // TODO: set same scale as enemy? silhouette.instance.GetComponent <SpriteRenderer>().sprite = enemy.silhouette; yield return(new WaitForSeconds(0.5f)); portal.Return(); silhouette.Return(); EnemyPoolItem item = enemy.pool.Pop(location); DamageTaker taker = item.instance.GetComponent <DamageTaker>(); item.instance.GetComponent <EnemyTracker>().difficulty = enemy.difficulty; item.instance.GetComponent <EnemyTracker>().parent = this; taker.OnDie.AddListener(this.OnEnemyDie); }