How to have animation when orientation changes

I want to have my iPhone app only display only landscape left and landscape right. However, when the app changes orientation I want it to show the standard rotation animation that iOS applications do when they rotate. In noticed that the Penelope sample application supports this kind of animation, but I haven’t been able to get it working for mine. Is there something special that needs to be done? I using the following script, but instead of animating to the new orientation, the app will immediately redraw in the new orientation:

using UnityEngine; 
using System.Collections;

public class OrientationScript : MonoBehaviour {

  void Start () {
    // see
    iPhoneKeyboard.autorotateToPortrait = false; 
    iPhoneKeyboard.autorotateToPortraitUpsideDown = false; 
    iPhoneKeyboard.autorotateToLandscapeRight = false; 
    iPhoneKeyboard.autorotateToLandscapeLeft = false;
  void Update () {
    if ((Input.deviceOrientation == DeviceOrientation.LandscapeLeft) 
           && (Screen.orientation != ScreenOrientation.LandscapeLeft)) {    
             Screen.orientation = ScreenOrientation.LandscapeLeft;
    else if ((Input.deviceOrientation == DeviceOrientation.LandscapeRight) 
         && (Screen.orientation != ScreenOrientation.LandscapeRight)) { 
           Screen.orientation = ScreenOrientation.LandscapeRight;

It appears that this is a feature currently not supported by iOS Unity 3.3.


This is a feature of Unity 3.4. See the discussion here to see how to get this working: iOS - Smooth auto-rotation of orientation - Questions & Answers - Unity Discussions