randomize an enum Direction with Vertical and Horizontal
public enum Direction { Vertical, Horizontal } public static Direction RandomizeDirection() { return Random.Range(0f, 1f) > 0.5f ? Direction.Vertical : Direction.Horizontal; } RandomizeDirection();