Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Game Center code changes orientation of my game.

Discussion in 'iOS and tvOS' started by jerotas, Jun 6, 2015.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I have this line of code:

    Social.ShowLeaderboardUI();

    and it changes my game on iPad2 from portrait to landscape to display a message "Game Center is unavailable. Player is not signed in". Then after I dismiss it with an "ok" button it goes back to portrait. Why would it do that and how can we prevent it? The message isn't even true because I am signed in to Game Center on this device.

    I'm on the newest Mac OS and XCode, with Unity 4.6.
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Bump. Seriously no one has seen this? Or am I the only one making a portrait game? Might be that one.
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    >>Or am I the only one making a portrait game? Might be that one.
    oh yes. If you want to hear me rant: presentation controller are absolute evil F***ed up S***. Yes, they kinda "override" your orientation constraints. What you can try doing (but ONLY if you develop portrait-only app):
    in UnityAppController.mm
    search for
    - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window

    tweak its implementation so it returns only orientations you want (please bear in mind that comments do tell the true story - this is very naughty area of ios, so you need to be careful, but portrait-only should be fine i hope)

    P.S. bumping saturday's post on monday morning... might be considered not cool at all ;-)
    P.P.S you can guess S*** word i guess (yay at forum software, it might help my posts to be less harsh for some ;-))
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Thank you, will try. Will Unity attempt to fix this "seems like a bug" in an update?
     
  5. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    >>Will Unity attempt to fix this "seems like a bug" in an update?
    no.
    check comments, they explain what happens and why it is made so.
    this is perfect area to celebrate that we have trampoline that you can tweak ;-)
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Ok, but this is only half of my question in the OP. Why is it saying "Game Center is unavailable. Player is not signed in" when I clearly am?
     
  7. ivan3d

    ivan3d

    Joined:
    Sep 5, 2015
    Posts:
    2
    Last edited: Aug 30, 2016