Game: Allow only landscape orientation

parent bad106a2
...@@ -21,12 +21,14 @@ namespace Assets.Scripts ...@@ -21,12 +21,14 @@ namespace Assets.Scripts
private int mult = 1; private int mult = 1;
void Start() void Start()
{ {
size = BG.GetComponent<SpriteRenderer>().sprite.bounds.size;
tra = BG.GetComponent<Transform>();
Screen.autorotateToLandscapeRight = true; Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true; Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation; Screen.orientation = ScreenOrientation.AutoRotation;
size = BG.GetComponent<SpriteRenderer>().sprite.bounds.size;
tra = BG.GetComponent<Transform>();
} }
void Update() void Update()
......
...@@ -22,6 +22,8 @@ public class GameOver : MonoBehaviour ...@@ -22,6 +22,8 @@ public class GameOver : MonoBehaviour
{ {
Screen.autorotateToLandscapeRight = true; Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true; Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation; Screen.orientation = ScreenOrientation.AutoRotation;
} }
......
...@@ -18,6 +18,8 @@ public class HighScores : MonoBehaviour { ...@@ -18,6 +18,8 @@ public class HighScores : MonoBehaviour {
void Start () { void Start () {
Screen.autorotateToLandscapeRight = true; Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true; Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation; Screen.orientation = ScreenOrientation.AutoRotation;
ScoreText.text = ""; ScoreText.text = "";
Server = gameObject.GetComponent(typeof(Server)) as Server; Server = gameObject.GetComponent(typeof(Server)) as Server;
......
...@@ -9,6 +9,8 @@ public class Menu : MonoBehaviour { ...@@ -9,6 +9,8 @@ public class Menu : MonoBehaviour {
void Start () { void Start () {
Screen.autorotateToLandscapeRight = true; Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true; Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation; Screen.orientation = ScreenOrientation.AutoRotation;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment