Returns the facing direction of unit UID. Behaves differently depending on the unit's rotate mode:
For units in rotate mode 0 (constant, such as emitters and reactors), direction is always 0.
For units in rotate mode 1 (left/right, such as most player-built ships), direction is 0 if facing right or 1 if facing left.
For units in rotate mode 2 (four-way, only possible in custom units), direction is 0 if facing right, 1 if facing up, 2 if facing left or 3 if facing down.