Пример #1
0
    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);
    }
Пример #2
0
 public EnemyTracker Set(EnemyPoolItem item)
 {
     this.item = item;
     return(this);
 }