From 26b8a13e9fd8ca49a12526098e42725a52183925 Mon Sep 17 00:00:00 2001 From: Paul-Louis NECH Date: Sat, 29 Oct 2016 16:43:33 -0400 Subject: [PATCH] Scenes: Allow any landscape orientation --- Assets/Scripts/GameController.cs | 4 +++- Assets/Scripts/GameOver.cs | 5 ++++- Assets/Scripts/HighScores.cs | 3 +++ Assets/Scripts/Menu.cs | 4 +++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs index 059bf44..40eac0b 100644 --- a/Assets/Scripts/GameController.cs +++ b/Assets/Scripts/GameController.cs @@ -24,7 +24,9 @@ namespace Assets.Scripts { size = BG.GetComponent().sprite.bounds.size; tra = BG.GetComponent(); - Screen.orientation = ScreenOrientation.LandscapeLeft; + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; } void Update() diff --git a/Assets/Scripts/GameOver.cs b/Assets/Scripts/GameOver.cs index cfa0e96..46491e6 100644 --- a/Assets/Scripts/GameOver.cs +++ b/Assets/Scripts/GameOver.cs @@ -19,7 +19,10 @@ public class GameOver : MonoBehaviour public Button buttonPlay; void Start() - { + { + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; } void Update () diff --git a/Assets/Scripts/HighScores.cs b/Assets/Scripts/HighScores.cs index dba67d0..dd14821 100644 --- a/Assets/Scripts/HighScores.cs +++ b/Assets/Scripts/HighScores.cs @@ -16,6 +16,9 @@ public class HighScores : MonoBehaviour { // Use this for initialization void Start () { + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; ScoreText.text = ""; Server = gameObject.GetComponent(typeof(Server)) as Server; } diff --git a/Assets/Scripts/Menu.cs b/Assets/Scripts/Menu.cs index 80218c4..1a58a65 100644 --- a/Assets/Scripts/Menu.cs +++ b/Assets/Scripts/Menu.cs @@ -7,7 +7,9 @@ public class Menu : MonoBehaviour { // Use this for initialization void Start () { - + Screen.autorotateToLandscapeRight = true; + Screen.autorotateToLandscapeLeft = true; + Screen.orientation = ScreenOrientation.AutoRotation; } // Update is called once per frame -- libgit2 0.27.0