2014-10-16 25 views

回答

0
ScreenOrientation ConvertToUnityScreenOrientation(UIInterfaceOrientation hwOrient,EnabledOrientation* outAutorotOrient){ 
    EnabledOrientation autorotOrient  = autorotPortrait; 
    ScreenOrientation unityScreenOrient = portrait; 
    switch (hwOrient) 
    { case UIInterfaceOrientationPortrait: 
      autorotOrient  = autorotPortrait; 
      unityScreenOrient = portrait; 
      break; 
     case UIInterfaceOrientationPortraitUpsideDown: 
      autorotOrient  = autorotPortraitUpsideDown; 
      unityScreenOrient = portraitUpsideDown; 
      break; 
     case UIInterfaceOrientationLandscapeLeft: 
      autorotOrient  = autorotLandscapeRight; 
      unityScreenOrient = landscapeRight; 
      break; 
     case UIInterfaceOrientationLandscapeRight: 
      autorotOrient  = autorotLandscapeLeft; 
      unityScreenOrient = landscapeLeft; 
      break; 
    } 
    if (outAutorotOrient) 
     *outAutorotOrient = autorotOrient; 

    return portrait; // Now works in Landscape >.< 
} 
+0

我們可以使用這種方法,我不能格式化這個答案對不起 – 2014-10-17 04:29:35