[펌] 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
'Unity3D > Tips' 카테고리의 다른 글
에셋 스토어(Asset Store)에서 다운받은 패키지의 저장 폴더 (0) | 2016.11.17 |
---|---|
[펌] Borderless window in standalone player (0) | 2016.11.08 |
[링크] Unity Technologies (0) | 2016.11.01 |
[펌] 유니티 최적화 Tips (0) | 2016.10.26 |
[펌] 유니티 SendMessage 사용의 장점 (0) | 2016.10.26 |