Assets/Game_Scripts/LevelManager.cs
/// <summary>
/// Ensures the next direction is never the same as the last
/// </summary>
Ensures the next direction is never the same as the last
Ensures the next direction is never the same as the last
Direction GetNewDirection(Direction oldDirection) {
        Direction newDirection = oldDirection;
        while (newDirection == oldDirection) {
            newDirection = (Direction)Random.Range(0, 4);
        }
        return newDirection;
    }
Direction GetNewDirection ( Direction oldDirection ) { Direction newDirection = oldDirection ; while ( newDirection == oldDirection ) { newDirection = ( Direction ) Random . Range ( 0 , 4 ) ; } return newDirection ; }
Ensures the next direction is never the same as the last
Ensures the next direction is never the same as the last
oldDirection
Direction