unity 2d enemy field of view

C#
 if (Vector3.Distance(playerPosition, EnemyPosition) < 22.5)
 {
   Debug.Log("I'm seeing the player");
 }
Source

Also in C#: