Exemple #1
0
 void Die()
 {
     isDead = true;
     EnemyHPManager.GetInstance().enemyList.Remove(this);
     anim.SetTrigger("isDead");
     Invoke("Delete", 0.9f);
     PlayDataManager.Instance.GameScore += 10;
 }
Exemple #2
0
    public void CreateEnemy(EEnemyType type, Vector3 pos)
    {
        var enemy = Instantiate(enemyPrefabs[(int)type], canvasParent);

        enemy.transform.localPosition = pos;
        enemy.GetComponentInChildren <EnemyMovement>().SetTarget(player);

        EnemyHPManager.GetInstance().enemyList.Add(enemy.GetComponentInChildren <EnemyHealth>());
    }