初期向きを横向きにする
Dafault OrientationをLandscapeLeftかLandscapeRightに変更すれば起動時から向きを横向きにできる。
ネットだとここをAutoRotationにしてるものが多かったがそれだと最初縦画面になってしまいました。
Dafault OrientationをAutoRotationにしてスクリプトのStart内でLandscapeLeftかLandscapeRightに変更すると最初一瞬だけ縦画面になってしまうので注意
回転できるようにする
あとはスクリプトで回転できるように指定してあげればいい
void Start() { Screen.orientation = ScreenOrientation.AutoRotation; Screen.autorotateToPortrait = false; Screen.autorotateToLandscapeLeft = true; Screen.autorotateToLandscapeRight = true; Screen.autorotateToPortraitUpsideDown = false; }