I figured it out. A forum user named DrHeinous got me started in the right direction:
http://forum.unity3d.com/threads/how-can-i-play-a-specific-animation-upon-a-combination-of-inputs-using-the-blend-tree.338935/
The trick seems to be to using counters to see if the right combination and order of inputs is pressed:
// Update ################################################################################### //
void Update()
{
// movement ============================================================================= //
// get player input and store values as floats
// default settings from "Edit -> Project Settings -> Input"; already mapped to arrow keys;
// inputs will be 0, 1, or -1, which determine the direction of movement on a coord
// plane; no key press is 0, right is 1, left is -1, up is 1, down is -1
animInputLeftRight = Input.GetAxisRaw("Horizontal"); // 0.0f, 1.0f, or -1.0f
animInputUpDown = Input.GetAxisRaw("Vertical"); // 0.0f, 1.0f, or -1.0f
// set movement inputs to values of animation inputs; this is done in order to separate
// animations from movement, as some animations should play regardless of what the
// movement inputs are
moveInputLeftRight = animInputLeftRight;
moveInputUpDown = animInputUpDown;
// define movement as the direction for both axes multiplied by 'playerSpeed'
playerMovement = new Vector2(moveInputLeftRight * playerSpeed.x,
moveInputUpDown * playerSpeed.y);
// animation ============================================================================ //
// favoring an animation is only done for up/down animations, as left/right animations are
// already favored while moving left, then up/down, or right, then up/down; the
// horizontal animations favored by default because their motions are listed first in
// the blend tree, and the first motions seem to be always favored by Unity
// up, then left or right --------------------------------------------------------------- //
// when moving up, then left/right (northwest/northeast), favor up animation
if (animInputUpDown == 1)
{
upLeftRightCounter++;
}
else
{
upLeftRightCounter = 0;
upLeftRightMotion = false;
}
if (animInputLeftRight != 0)
{
upLeftRightCounter++;
}
else
{
upLeftRightCounter = 0;
upLeftRightMotion = false;
}
// if counter = 2, up, then left/right motion is triggered
if (upLeftRightCounter == 2)
{
upLeftRightMotion = true;
}
// if motion is triggered, set y animation value to up (1)
if (upLeftRightMotion == true)
{
animInputLeftRight = 0;
animInputUpDown = 1;
}
// down, then left or right ------------------------------------------------------------- //
// when moving down, then left/right (southwest/southeast), favor down animation
if (animInputUpDown == -1)
{
downLeftRightCounter++;
}
else
{
downLeftRightCounter = 0;
downLeftRightMotion = false;
}
if (animInputLeftRight != 0)
{
downLeftRightCounter++;
}
else
{
downLeftRightCounter = 0;
downLeftRightMotion = false;
}
// if counter = 2, up, then left/right motion is triggered
if (downLeftRightCounter == 2)
{
downLeftRightMotion = true;
}
// if motion is triggered, set y animation value to down (-1)
if (downLeftRightMotion == true)
{
animInputLeftRight = 0;
animInputUpDown = -1;
}
// trigger animations ------------------------------------------------------------------- //
// if no inputs are 0, there is movement; set variables to trigger appropriate animations
if ((moveInputLeftRight != 0) || (moveInputUpDown != 0))
{
playerAnimator.SetBool("isWalking", true);
playerAnimator.SetFloat("inputX", animInputLeftRight); // will be either 1 or -1
playerAnimator.SetFloat("inputY", animInputUpDown); // will be either 1 or -1
}
// else inputs are 0, so there is no movement, therefore character is not walking
else
{
playerAnimator.SetBool("isWalking", false);
}
}
// FixedUpdate ############################################################################## //
void FixedUpdate()
{
// set the player obj's rigidbody2D velocity to player movement (direction * speed = vel)
playerRigidBody.velocity = playerMovement;
}