public void removeFromGame() { GameObject obj = GameObject.Find("Enemies"); if (obj) { EnemySubject eSub = obj.GetComponent <EnemySubject>(); if (eSub) { eSub.enemyState = EnemyState.EnemyKilled; } } Destroy(gameObject); }
void Start() { //Attach kill achievements to the enemy subject Achievement[] kAchievs = GameObject.Find("KillRelatedAchievements").GetComponents <Achievement>(); GameObject enemies = GameObject.Find("Enemies"); if (kAchievs.Length == 0 || !enemies) { return; } EnemySubject eSub = enemies.GetComponent <EnemySubject>(); if (eSub != null) { for (int j = 0; j < kAchievs.Length; j++) { eSub.attach(kAchievs[j]); } } }
public override void setSubect(Subject sub) { enSubject = (EnemySubject)sub; }