Game: Allow only landscape orientation

parent bad106a2
......@@ -21,12 +21,14 @@ namespace Assets.Scripts
private int mult = 1;
void Start()
{
size = BG.GetComponent<SpriteRenderer>().sprite.bounds.size;
tra = BG.GetComponent<Transform>();
{
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation;
size = BG.GetComponent<SpriteRenderer>().sprite.bounds.size;
tra = BG.GetComponent<Transform>();
}
void Update()
......
......@@ -22,6 +22,8 @@ public class GameOver : MonoBehaviour
{
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation;
}
......
......@@ -18,6 +18,8 @@ public class HighScores : MonoBehaviour {
void Start () {
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.orientation = ScreenOrientation.AutoRotation;
ScoreText.text = "";
Server = gameObject.GetComponent(typeof(Server)) as Server;
......
......@@ -9,6 +9,8 @@ public class Menu : MonoBehaviour {
void Start () {
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
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