Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity rotation 90 degrees when opening universal link #28

Open
nicolajbroby opened this issue Feb 20, 2018 · 0 comments
Open

Unity rotation 90 degrees when opening universal link #28

nicolajbroby opened this issue Feb 20, 2018 · 0 comments
Labels

Comments

@nicolajbroby
Copy link

This is a bug that Unity has to fix. Temp. fix:

void Start(){
        // Check if the screen orientation is not landscape
        if (Screen.orientation == ScreenOrientation.Portrait || 
            Screen.orientation == ScreenOrientation.PortraitUpsideDown) {
            StartCoroutine (FixLandscape ());
        } else {
            // Nothing to worry about, call Megacool as normal
            StartMegacool ();
        }
    }
    IEnumerator FixLandscape(){
        // Turn the screen to landscape left to "reset" to the right size
        Screen.orientation = ScreenOrientation.LandscapeLeft;
        // Let the rotation happen
        yield return new WaitForSeconds(0.5f);
        // Go back to auto rotation to reset to the right orientation
        Screen.orientation = ScreenOrientation.AutoRotation;
        //Call Everything Megacool related
        StartMegacool();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant