Hello !, I made a script of a collider trigger because it was my only alternative, it works, when the player enters the cone trigger (mesh) the enemy is disturbed, but you can see me through obstacles like walls, someone knows something?

using System.Collections;

public class VisionCone : MonoBehaviour {

	public GameObject EnemyGameObject;
	public GameObject Player;

	void Start () 
	{

	}
	
	void OnTriggerEnter (Collider other) 
	{
		if (other.tag == "Player") {

		EnemyGameObject.gameObject.GetComponent<Enemy>().Distancia = EnemyGameObject.gameObject.GetComponent<Enemy>().DetectedDistance; 
		EnemyGameObject.gameObject.GetComponent<Enemy>().LastDistance = EnemyGameObject.gameObject.GetComponent<Enemy>().DetectedLastDistance;  
	}
  }
}

To detect entering the player, add new object with capsule collider at cone inlet and resize to cover cone inlet. Add your script which has OnTriggerEnter method to this object.
Not to pass through from cone’s walls add mesh collider to your cone and check Convex checkbox of mesh collider.
131180-answ.png

When en enemy detects you player you should do a raycast from his position to your players. This way if there is a wall in between it should block it.