Check Between Enemy List

Hi, i’m trying to finish a TD and i have the last problem. When i press return enemies spawn and they get into a List and walk in paths, i have towers near the paths so they can shoot. My problem is that i do a for to recognize all of them and check wich is the nearest to my tower. i have a state pattern in my towers so i have something like this.
What i try to do is : i have 2 enemies, and two towers, i want to make the tower attack the nearest enemy, and the aother tower attack the otherone (that is nearest to it) but my problem is that both towers recongnize the first enemy and wait him to be nearest and perhaps another enemy pass behind a tower and it dont attack :frowning:

in State Iddle (Context is the ‘‘ParentClass’’)

public void UpdateIdle(Context context) {
    context.myEnemyList = context.enemiesList.enemies;
    if (context.tower)
    {

        if (context.myEnemyList != null)
        {

                for (int i = 0; i < context.myEnemyList.Count; i++)
                {
                    context.myEnemyList *= GameObject.FindWithTag("Enemy");*

if (Vector3.Distance(context.tower.transform.position, context.myEnemyList*.transform.position) < 15)*
{
context.enemy = context.myEnemyList*;*
Debug.Log(context.i);
context.SetState(new StateAttack());

}
}
}
}

How about a “I’m Being Attacked” boolean? When the tower01 attacks, the enemy01 “I’m Being Attacked” boolean becomes true. So, when tower02 goes to attack enemy01, it finds the boolean switched on, so it ignores it and looks for a different enemy?