Lock orientation within the app

Is there a way to lock the orientation on the device from within the app, not within build.settings?

My tablet game has a solo play mode and a competitive play mode. In solo play mode, I want to allow for orientation change so players can play in landscape or portrait mode. In competitive play mode, I want to only allow portrait mode so that the screen is correctly laid out for head-to-head play on the device.

Can I do that? Can I lock the orientation when in a certain mode of the game? [import]uid: 17827 topic_id: 21055 reply_id: 321055[/import]