void MakeInstance() { if (instance == null) { instance = this; } }
void Die() { isDead = true; EnemyHPManager.GetInstance().enemyList.Remove(this); anim.SetTrigger("isDead"); Invoke("Delete", 0.9f); PlayDataManager.Instance.GameScore += 10; }
public static EnemyHPManager GetInstance() { if (instance == null) { instance = new EnemyHPManager(); } return(instance); }
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>()); }
void Awake() { enemyHP = GetComponent <EnemyHPManager>(); }