Prevent NavMesh from Moving Diagonally?

I am making a game and I currently have my player set up to only be able to move forwards, backwards, left, and right. I have an enemy which I have given a NavMesAgent component. I want this enemy to only be able to move forwards, backwards, left, and right (not diagonally). I know that NavMesh components work off of the shortest distance to the destination set but I was wondering if there would be a way to force the NavMeshAgent to only move in the same directions as my player. If it’s not possible, I completely understand but I feel like there is some algorithm that could be built to prevent the NavMeshAgent from moving diagonally. Any suggestions?

You could set nav agent’s angularSpeed = 0 and rotate him to one of the four predefined directions (forward, backward, left or right) manually, and then set his destination.
Then, he could have a posibility to turn in another direction, so you’ll need to rotate him manually everytime. And it should be done with some delay, so agent could not turn in every frame (because in this case he still will be moving diagonally).
To determine the direction to rotate nav agent, you’ll need to check the direction from its current position to the target position, and check the direction’s x and z values.

Vector3 direction = navAgent.destination - navAgent.transform.position;
direction.y = 0f;

//if absolute unsigned value of 'x' is higher that unsigned value of 'z'
if (Mathf.Abs (direction.x) > Mathf.Abs.direction.z)
    //then we know that nav agent should turn straight to the right (on X axis)
    //so, set the forward axis to '0'
    direction.z = 0f;
else
    //otherwise make him turn straight to Z axis (set the right axis to '0')
    direction.x = 0f;

//we've set 'direction.y' to '0' earlier so we could rotate transform to the direction
//and it will be rotated around its Y axis only.
navAgent.transform.rotation = Quaternion.LookAt (direction);

Something like that, I think. I didn’t test this code, so I’m not sure if it’s working. It’s just an example of how I would do this.
Remember that this direction change should be done only once at some period of time, so your nav agent won’t be allowed to change its rotation in every ‘Update()’.