Exemplo n.º 1
0
    public void ReleaseEnemy(BaseEnemy enemy)
    {
        if (m_JailEnemies.Count <= 0)
        {
            throw new UnityException("No enemies to release from jail");
        }

        AlertBuilder.EnemyEscapedAlert(enemy.GetType().ToString());

        m_FreeEnemies.Add(enemy);
        m_JailEnemies.Find(x => x.Equals(enemy)).Enabled(true);
        m_JailEnemies.Remove(enemy);

        GameController.Current.UpdateScore();
    }
Exemplo n.º 2
0
    public void ReleaseRandomEnemy()
    {
        if (m_JailEnemies.Count <= 0)
        {
            throw new UnityException("No enemies to release from jail");
        }

        int randEnemy = Random.Range(0, m_JailEnemies.Count);

        AlertBuilder.EnemyEscapedAlert(m_JailEnemies[randEnemy].GetType().ToString());

        m_FreeEnemies.Add(m_JailEnemies[randEnemy]);
        m_JailEnemies[randEnemy].Enabled(true);
        m_JailEnemies.RemoveAt(randEnemy);

        GameController.Current.UpdateScore();
    }