private void SearchState()
{
if (CanSeePlayer())
{
_searchAmount = 0;
State = EnemyState.Detect;
}
var stopAmount = Math.Abs(_searchAmount - transform.rotation.eulerAngles.y);
if (stopAmount < 3 || (stopAmount - 360 < 3 && stopAmount - 360 > 0))
{
_searchDir = !_searchDir;
_searchAmount = (int)transform.rotation.eulerAngles.y + (120 * (_searchDir ? 1 : -1));
}
transform.Rotate(0, 1 * (_searchDir ? 1 : -1), 0);
}