Пример #1
0
    public void removeFromGame()
    {
        GameObject obj = GameObject.Find("Enemies");

        if (obj)
        {
            EnemySubject eSub = obj.GetComponent <EnemySubject>();
            if (eSub)
            {
                eSub.enemyState = EnemyState.EnemyKilled;
            }
        }

        Destroy(gameObject);
    }
Пример #2
0
    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]);
            }
        }
    }
Пример #3
0
 public override void setSubect(Subject sub)
 {
     enSubject = (EnemySubject)sub;
 }