void RegisterEnemies()
    {
        string[]   enemyTeams  = teamHandler.GetPlayerTeam().enemyTeams;
        List <int> enemyLayers = new List <int>();

        for (int i = 0; i < enemyTeams.Length; i++)
        {
            enemyLayers.Add(LayerMask.NameToLayer(enemyTeams[i]));
        }
        registeredEnemies = FindGameObjectsWithLayer(enemyLayers);
        if (registeredEnemies != null)
        {
            registeredEnemiesAIBase = new AIBase[registeredEnemies.Length];
            for (int i = 0; i < registeredEnemies.Length; i++)
            {
                registeredEnemiesAIBase[i] = registeredEnemies[i].GetComponent <AIBase>();
            }
        }
    }