how to make the enemy patrol, see and shoot

I wonder do with the enemy of my game ships patrolled stay and then when a certain proximity of my player he shoots towards my player

http://unity3d.com/learn/tutorials/modules/beginner/physics/colliders-as-triggers