void Die() { isDead = true; EnemyHPManager.GetInstance().enemyList.Remove(this); anim.SetTrigger("isDead"); Invoke("Delete", 0.9f); PlayDataManager.Instance.GameScore += 10; }
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>()); }