Create LineOf ight

Here's how it works:

Start finds its parent object and grabs whatever move script is attached. Not having movement in this script allows this script to be more universal. 

Update just checks if a player is spotted, if so move using the move function in the move script. Else don't move. 

Add a collider to your enemy. Make this collider the are of sight and check it as isTrigger. If player comes within range, call function sight.

Sight has an old debug line that draws a line within the pause scene menu a line from the enemy to the player. 
It then checks to see with linecasting if a object in layer barrier is hit before the player. If so, ignore player.
If Player is closest, change spotted to true. 

OnTriggerExit2D just stops the enemy from chasing the player once the player is out of range. 

Important things to make work: Add rigidbodies to enemy and player and set their gravity to 0, is Kinematic should be false (opposed to gravity =1 and kinematic to true).

Give you player a "Player" tag. Create and give the player object a layer "Player". Its easy, just google unity layers and you'll find how to add custom layers. 

Give your walls a custom layer "Barrier". 

Separate your movement script from this script. Call your movement script whatever you want (i didn't make that part universal yet) but you will have to change instances of "Kill" in my script to whatever the name of your movement is. 

This technique of colliders and line casting seems to be the quickest and easiest way of doing line of sight.