Added new IsUnitSelected helper function for clarity.