[펌] Disable Screen Auto Rotation on Unity3D
[추가]
Landscape은 아래 2개 변수를 제어
Screen.autorotateToLandscapeLeft
Screen.autorotateToLandscapeRight
Disable screen auto-rotation in a game in Unity.
Option 1
Create a script that disables auto rotate to portrait and sets the orientation to landscape.
using UnityEngine;
public class CameraScript : MonoBehaviour {
void Start() {
DisableAutoRotation ();
}
public void DisableAutoRotation() {
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.Landscape;
}
}
Create a game object to attach the script to. This can be any game object. You could also attach the script to the main camera in the scene either. When the game is run on hand held devices, the autorotation will be disabled.
Option 2
Another solution to this problem is to change this setting when building the project.
Go to
File -> Build Settings...
[출처] http://andrewstutorialblog.blogspot.kr/2014/12/disable-screen-auto-rotation-on-unity3d.html