Okay, how does SetCursor work?

I have these two functions:

public static void DefaultCursor()
{
    Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
    Cursor.lockState = CursorLockMode.None;
}
public static void TargetCursor()
{
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.SetCursor(cursor, Vector2.zero, CursorMode.Auto);
}

The first one is supposed to set the cursor to the default, and also unlock it so the player can control it.

The second is supposed to lock it to the center, and set it to ‘cursor’, a reference to a Texture2D cursor icon I assigned.

And what I find is that this just doesn’t happen properly. I set it up (for testing purposes) to call the Default when I press the number 1 and to call the Target when I press 2.

I have to press 2 twice to get it to change to the target. And pressing 1 any number of times doesn’t change it back to the default, but if I press 1 and then 2 again, it does change it back to the default. I have to press 1 first, then 2 again to get it to go to default. Pressing 2 any number of times won’t default it by itself.

This is behavior I do not understand. What could I be missing here?

Thanks!

It appears that it works fine in a standalone build, just not in the editor.