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

Unity iPhone enhancement pack

Discussion in 'iOS and tvOS' started by bliprob, Feb 2, 2009.

  1. Gaspedal

    Gaspedal

    Joined:
    Mar 29, 2009
    Posts:
    376
    thanks, I have now added UIKeyboardTypeNamePhonePad and it work fine :)
    Only the shift key is now always disabled (lower letters).
     
  2. DEFYN

    DEFYN

    Joined:
    May 26, 2009
    Posts:
    5
    Hey Guys, I took a look at some of the previous posts and saw that everything seems to be working smoothly for everyone in regards to the new 3.0 release...

    With that being said, we are currently in the process of submission with our application and hit a last minute complication.

    GUI textfields (username, password, email) in our app/game are being updated with getKeystrokes/sb_result.

    The issue is that the copy/paste undo typing functionality in the new 3.0 isn't working at all. I tried switching out my text fields for GUI Label, Text Area, and Text Field to see if it might change interaction with no progress what so ever. Do I need to switch to getInput?

    It works otherwise, but I don't think Apple will accept our app with the lack of these new implemented functions.

    Id much appreciate any helpful thoughts, advice, or insight you all might have. Cheers!
     
  3. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Back when the EP first came out, the consensus was that everyone wants to handle text drawing on their own inside Unity, so the "getKeystrokes" field that the keyboard uses is hidden and sends each keystroke to Unity.

    But yes, you should probably use getInput instead of getKeystrokes, because I'm not sure how copy paste sends changes to the keyboard delegate. Probably the same, but I'm not entirely sure.

    To get copy paste, you'd need the actual field (not your surrogate Unity field) to be shown. This is a simple matter of adjusting the frame rectangle (of both the window and the field) to make it visible.

    I can't experiment right now, but I will try it in a few days.
     
  4. DEFYN

    DEFYN

    Joined:
    May 26, 2009
    Posts:
    5
    Thanks Stink. I'll keep an eye on the forum for your response. Also, I'll post if we make any any decent progress or come up with a solid work around.
     
  5. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    698
    another question about videos: Is there a way I can make a video play maximized by default? (Iif is 4:3 it will show black bars on the left and right and only once you double-tap it will zoom in...)
     
  6. Grind

    Grind

    Joined:
    Oct 22, 2008
    Posts:
    21
    Picking up some old posts regarding the "No method at 0xfacebeef" crash with iPhone SDK 3.0.

    Has anyone found a good solution to this? I first stepped on this one with Beta5, at that time I somehow managed to maneuver around it and continue. With the release of GM seed it started crashing again and I haven't been able to solve it, still crashing with 3.0 final.

    I have a project the works well "out of the box" and with my changes added (similar to the iPhone Enhancement Pack).
    Another project is working fine "out of the box", but crashes with my changes.

    I have come down to one line of code making the application to crash with the message above. Changing the following line in AppController.mm:
    Code (csharp):
    1. UnityInitApplication(appPath);
    to
    Code (csharp):
    1. [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    2. UnityInitApplication(appPath);
    will make the app crash. The code isn't doing much, still the application crashes. Changing UIWindow to UIView or any subclass of UIView will trigger this error. If the allocation and initialization of the UIWindow is moved after the call to UnityInitApplication, the application continues without crashing.

    Someone, please?
     
  7. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    This was fixed by Unity. What version of Unity are you using?
     
  8. Grind

    Grind

    Joined:
    Oct 22, 2008
    Posts:
    21
    I'm using Unity iPhone Advanced 1.0.2 (I haven't upgraded to 1.0.3 yet since it (reportedly) only fixes issues with compressed audio).
     
  9. Grind

    Grind

    Joined:
    Oct 22, 2008
    Posts:
    21
    Making the changes I mentioned above in the Star Trooper example project causes this error to occur (at least for me...).

    Using an initial empty scene loading the main scene (as proposed earlier in this thread) makes the application start without problem. However, when I later in my application try to show some Cocoa Touch UI, the app crashes with the same error message. I have not been able to reproduce that in Star Trooper.
     
  10. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Yes, it's definitely broken in 1.0.2. The Enhancement Pack is doing nothing wrong, and there's no other workaround. You need to upgrade.

    I'm not entirely sure if it's fixed in 1.0.3 (can anyone else confirm?). It seems to work here.

    If you don't want to upgrade to 1.0.3, send an email to Unity and ask to join the 1.1 beta, as I've been told it's definitely fixed in that release.
     
  11. Grind

    Grind

    Joined:
    Oct 22, 2008
    Posts:
    21
    I did upgrade to 1.0.3 and still have the problem, really odd.

    Anyway, I've done some more debugging (never ending story this is). My problem to show some Cocoa Touch UI later in the application seems to have something to do with animations. Turning those off with [UIView setAnimationsEnabled:NO] finally lets me open up a new UIWindow to work with. This workaround does not help the initial problem though, creating UIViews before the call to UnityInitApplication is still a NO NO.

    Hmm, this is probably a bit off-topic now since it doesn't have anything to do with the Enhancement Pack. I'm only experiencing the same problems that a few others do with it (since I'm doing more or less the same things). I've filed a bug report and hope to get a response soon, or a 1.1 release would be even better :)
     
  12. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Tomas, if it's a show stopper for you, please do contact Unity and get added to the 1.1 beta.
     
  13. grant-adam

    grant-adam

    Joined:
    Nov 23, 2008
    Posts:
    57
    FWIW.

    I've been having various errors with crashing recently.

    One app I went to update the other day was crashing during load. Removing the enhancement stuff, no dice. After fiddling for a bit I tried the load-simple-level-then-load-level tip and it worked for me and has continued to work.

    Another app which I've just started (so not a complex setup yet) was inconsistent - in that I would delete various objects to see what was causing the problem, and it would occasionally work then wouldn't. For that one I had a linerenderer object visible onscreen at startup, I found if I moved it offscreen it wouldn't crash on load and has been consistenly good now, but I'm not hugely confident it will continue to work.

    I'm still on 1.0.2 since I heard 1.0.3 stops ipods again, and I don't have any audio problems.

    cheers,
    grant
     
  14. Grind

    Grind

    Joined:
    Oct 22, 2008
    Posts:
    21
    Thanks for the advice. It's not a show stopper for me, the project is in a quite early stage and the problem is now mostly an annoyance and a time consumer (I've probably dug well over a day worth of work into it).

    I saw that tip earlier in the thread and I actually deactivated almost all objects in the scene without any positive result. I'm a Unity Rookie coming in from iPhone so I don't know the inheritance of all the Unity classes I'm using, maybe there is something in that setup I can look into.

    For now, I'll stick to 1.0.3 with the current solution until I hit the next wall. It's sort of ugly now but I can move on and add some functionality. Thanks for all your help and advice, I'll keep you posted if I happen to nail it down :)
     
  15. Nevesola

    Nevesola

    Joined:
    Jan 14, 2009
    Posts:
    14
    First off, thanks for the EP, its made life so much easier for a few things that my project has needed :D

    Onward, I'm running into that dreaded 3.0 freeze every frame or so, the game is playable but feels clunky. I did upgrade to unity 1.03 without luck. The problem, in part, is caused by an mp3 file playing for background music. If I remove it, alls well in the world again. However, if I remove the enhancement pack but not the music, the hiccup goes away as well.

    I very much doubt its the EP, but its strange that I still get the reported 3.0 slowdown while playing compressed audio with the hotfixed unity, but it corrects itself without the EP built into the project. Sadly, the project can't live without the EP(far too valuable).

    I've tried disabling the audio initialize section of the EP, as was suggested earlier in this thread to fix a different problem, but no result. I've also tried various project builds(Build for 3.0, 2.1 and 2.2.1). I've even completely reimported the offending audio files. All my tests are on a beta5 3.0 iPhone and a released 3.0 ipod touch.

    Its odd that both the EP and compressed audio have to be present to cause the problem. Any suggestions would be very welcome.
     
  16. Nevesola

    Nevesola

    Joined:
    Jan 14, 2009
    Posts:
    14
    I've been able to duplicate the problem with a minimal project. Camera, spinning cube, and an object playing our compressed audio background music, all build with the enhancement project(not using any of the features however).
     
  17. cavalcade

    cavalcade

    Joined:
    Apr 17, 2009
    Posts:
    40
    we have been deciding back and forth for almost 2 months if we should purchase this pack, the only relevant feature for us is the 2nd splash screen. It seems this pack is never gonna get updated with new features (we've been holding off but its been too long). Are their any hidden enhancement that can be applied to any game?
     
  18. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The pack got a few massive additions with 1.1 actually.
    From movie playback over streaming audio and gps location there are quite a few features that one might have more or less use for it. Also I highly doubt that the iPhone keyboard is that unimportant to not count it in as a feature.

    For me an additional point behind it is was that I have a central place to plugin in own external calls and use them through one and the same "interface".
     
  19. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    If you can duplicate in a minimal project, I'll be happy to look at it.
     
  20. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    If you don't want to buy the pack, you can make the changes to AppController.mm yourself. I posted the steps for making the 2nd splash screen on a thread on the forum.

    In fact, I've posted almost all of the pack at one point or another. There's not a lot of secret sauce in there, but I do think it's a good mix of useful things, all in one place. (I'd say the appcontroller category, postprocessbuild script and applescripts for adding stuff to XCode are the real secret sauce.)

    The pack has been under *significant* work to support Unity 1.1 and to support new 3.0 features. Unfortunately, making the pack support 3.0 while being backwards compatible with 2.0, plus making it work with both Unity 1.0.x and and the new build process of 1.1, is a significant challenge.
     
  21. Nevesola

    Nevesola

    Joined:
    Jan 14, 2009
    Posts:
    14
    Done and sent :D Thanks for your help.
     
  22. DEFYN

    DEFYN

    Joined:
    May 26, 2009
    Posts:
    5
    Hey Stink,
    Any word on the 3.0 text field issues? We are definitely in the trenches with this thing. Thanks for the help BTW.
     
  23. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    This will get the keyboard visible for cut/copy/paste. (Taken from the latest version of the Enhancement Pack, which is being targeted at Unity 1.1.)

    Add a new instance var:

    Code (csharp):
    1. int interfaceOrientation;
    Put this in applicationDidFinishLaunching:

    Code (csharp):
    1.     // how is the app oriented?
    2.     NSString* s = [[[NSBundle mainBundle] infoDictionary] objectForKey: @"UIInterfaceOrientation"];
    3.     if ( [@"UIInterfaceOrientationPortrait" isEqualToString: s] ) {
    4.         interfaceOrientation = UIInterfaceOrientationPortrait;
    5.     } else if ( [@"UIInterfaceOrientationLandscapeRight" isEqualToString: s] ) {
    6.         interfaceOrientation = UIInterfaceOrientationLandscapeRight;
    7.     } else if ( [@"UIInterfaceOrientationLandscapeLeft" isEqualToString: s] ) {
    8.         interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
    9.     }
    Replace the getInput method:

    Code (csharp):
    1. -(void)getInput
    2. {
    3.     DebugLog(@"getInput");
    4.     UnityPause(YES);
    5.    
    6.     w = [[UIWindow alloc] initWithFrame: CGRectMake(0, 0, 320, 24)];
    7.     if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
    8.         w.transform =   CGAffineTransformRotate(w.transform, -M_PI/2);
    9.         w.center = CGPointMake(40,240);
    10.     }
    11.     else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
    12.         w.transform =   CGAffineTransformRotate(w.transform, M_PI/2);
    13.         w.center = CGPointMake(280,240);
    14.     }
    15.    
    16.     UITextField *tf = [[UITextField alloc] initWithFrame: CGRectMake(2, 2, 300, 20)];
    17.     tf.delegate = self;
    18.     tf.adjustsFontSizeToFitWidth = YES;
    19.     tf.textColor = [UIColor whiteColor];
    20.     tf.font = [UIFont systemFontOfSize: 14.0];
    21.     tf.placeholder = @"";
    22.     tf.backgroundColor = [UIColor blackColor];
    23.     tf.autocorrectionType = UITextAutocorrectionTypeNo;        // no auto correction support
    24.     tf.autocapitalizationType = UITextAutocapitalizationTypeNone; // no auto capitalization support
    25.     tf.keyboardType = UIKeyboardTypeDefault; // use the default keyboard
    26.     tf.returnKeyType = UIReturnKeyDone;
    27.     tf.keyboardAppearance = UIKeyboardAppearanceAlert;
    28.     [w addSubview: tf];
    29.    
    30.     [w makeKeyAndVisible];
    31.     [tf becomeFirstResponder];
    32.    
    33. }
    34.  
     
  24. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    enhancemnt pack and mp3 make me the frame rate slow and unstable.

    removing all the mp3 or leaving the mp3 and removing enhancement pack the frame rate work fine .

    any solution? makes it just me?
     
  25. joelmgallant

    joelmgallant

    Joined:
    Mar 9, 2009
    Posts:
    113
    It's me too actually - getting that tiny intermittent stutter on scenes with compressed audio playing, even after the 1.0.3 update...
     
  26. Nevesola

    Nevesola

    Joined:
    Jan 14, 2009
    Posts:
    14
    I'm still getting it as well, post 1.03 build. I found a half fix. If you open up AppControllers+additions.mm and comment out this section:
    Code (csharp):
    1. AudioSessionInitialize (NULL,NULL,NULL,NULL);
    2.     UInt32  sessionCategory = kAudioSessionCategory_AmbientSound;
    3.     AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
    4.     AudioSessionSetActive(YES);
    It seems to help the stuttering significantly. You'll lose device mp3 playback, and there is still stuttering by you really have to be looking for it to notice. Give it a try and see if it helps at all.
     
  27. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    I have been looking into this problem for a couple of users.
    If you're using 1.0.3, you shouldn't have that code in there. Unity has been setting its own audio session category since 1.0.2. Please comment that out.

    The reason you lose MP3 playback without that code is that 1.0.3 sets the wrong category -- it sets AmbientSolo, which turns off iPod playback. I have heard that there is a Unity 1.0.4 build that fixes that iPod playback issue, but I haven't seen it myself yet.

    But definitely comment out those four lines!
     
  28. scinfu

    scinfu

    Joined:
    Oct 23, 2008
    Posts:
    404
    i have the 1.0.4f but the problem continue to exist
     
  29. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    698
    add me to the list of people with the studdering problem with mp3 background music.... One jitter every second or so... Turn off the music and everything's fine...

    This problem occurs on an iPhone 3G with OS 3.0.
    No Problem on a 2nd Gen iPod Touch with OS 2.2.1.

    If I comment out those four lines the problem is solved, but I have a new problem:

    First the sound is there, then I play a video with sound, then the sound is gone. The next cut-scene video has sound again, the next level is again without sound (both sound and mp3-background-music are gone)... (yes, I stop the music before I play the video) This is on the iPhone btw.

    On the iPod it's the other way around. Music and Sound work during the levels, but the cutscene movies are without sound...

    any ideas?
     
  30. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    You didn't say which OS version, but I'm guessing the video playback is probably changing the audio session category to kAudioSessionCategory_MediaPlayback. You can add the code (the same code I've recommended people remove from the start of the app) to moviePlaybackDidFinish: and see if that helps.
     
  31. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    698
    didn't help :( I added the code right before UnityPause(NO);
    your idea sounds pretty good though!

    maybe it shouldn't be kAudioSessionCategory_AmbientSound?

    On OS 3.0: Sound on Videos, no sound at all after playing a video. next video has sound again

    On OS 2.2.1: No sound on videos, but sound works in the game.

    EDIT: Oh and I just noticed: On OS 2.2.1 there is no sound on the video even WITHOUT the change. so, never. This is all in Unity iPhone 1.0.3f1
     
  32. jojan

    jojan

    Joined:
    Nov 6, 2008
    Posts:
    63
    I've reported the below problem to both Unity support and Stinkbot support, but I'm posting it here too in case anyone else is seeing the same problem.

    I'm in a bit of a bind. I'm using Unity iPhone plus the Enhancement Pack, and working on a game that's due for release this week.

    I upgraded from 1.01 to 1.02 for the SDK 3.0 compatibility. At which point I got the compressed audio performance bug. So I upgraded to 1.03 when that came out, but it only partially fixed the problem.

    What I get with 1.03 is that the game runs fine on my iPhone 3G with 3.0 firmware, but I get catastrophic performance on my 1st gen iPhone with 2.x firmware. So I applied for the 1.1 beta.

    With the 1.1 beta the performance issue is fixed. But when enabling the Enhancement Pack (which I need for keyboard input), it crashes with the message 'Program received signal: “EXC_BAD_ACCESS”.' I narrowed this crash down to the call UnitySetAudioSessionActive(true) in AppController.mm. If I remove this call, the app starts, but I get horrible performance again, presumably because the audio session isn't set up correctly.
     
  33. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    JohanPlanta (and everyone using 1.0.3 or higher), please comment out the these lines in the pack, lines 187-201 in AppController+additions.mm:

    Code (csharp):
    1.     AudioSessionInitialize (NULL,NULL,NULL,NULL);
    2.     UInt32  sessionCategory = kAudioSessionCategory_AmbientSound;
    3.     AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
    4.     AudioSessionSetActive(YES);
    (In case you're wondering, in Objective-C++ a "//" starts a line comment).

    The Unity engine now sets the audio session category at startup, so there's no need for the Enhancement Pack to do it (and it seems to be causing a conflict).

    Remember, Unity 1.0.3 has a known bug where it won't let iPod audio play at app startup. I have heard there is an as-yet unreleased 1.0.4 that fixes this audio issue; please contact Unity support if you need it. The Enhancement Pack can't fix the startup iPod playback issue since the engine sets the audio session category, so you need to get the fix for that from Unity.

    JohanPlanta: I have tested the pack in Unity 1.1 beta 3 and found no issues (with the above lines commented out). If you want, send me your XCode project (clean all first binaries, please) and I will look at it.

    Note that Unity 1.1 has its own keyboard command, so you don't have to use the Enhancement Pack if it's causing you trouble.
     
  34. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    698
    1) Any news on video-playback breaking the sound? Anyone else using video-playback and having troubles?

    2) Is there a way to get a gapless transition from the loading screen to the first frame of the game? (Is it possible to disable the fade to black, and if so: will there be any black frames in between the loading screen and the first frame of unity?)

    3) How could I approach playing a video before the engine loads?

    4) Thanks for all the help and the great support!
     
  35. HMachuca

    HMachuca

    Joined:
    May 4, 2009
    Posts:
    36
    Hey guys I'm having a little problem using the keyboard. It works great but my situation may be a little different. For high scores, I'm only allowing a maximum of 10 characters for a player name. This is my code:

    Code (csharp):
    1.  
    2.              char[] delimiters = { '|', };
    3.                
    4.                 m_szResult = PlayerPrefs.GetString("sb_result");
    5.                 m_KBInput = m_szResult.Split(delimiters);
    6.                
    7.                 if(m_szResult != "")
    8.                 {
    9.                     if(m_KBInput[0] == "keystroke")
    10.                     {
    11.                         if(m_KBInput[1].Length <= 10)
    12.                         {
    13.                             m_szPlayerName = m_KBInput[1];
    14.                             m_szValidResult = m_KBInput[1];
    15.                             m_guiName.guiText.text = m_szPlayerName;
    16.                         }
    17.                         else if(m_KBInput[1].Length > 10)
    18.                         {
    19.                             PlayerPrefs.SetString("sb_result", "keystroke|" + m_szValidResult);
    20.                         }
    21.                     }
    22.                 }
    23.                
    24.                 if(m_szResult != ""  m_KBInput[0] != "keystroke")
    25.                 {  
    26.                     m_Settings.SetHighScore(m_nRank, m_Player.GetScore(), CWaveManager.Instance.GetCurrentWave(), m_szPlayerName);
    27.                     Application.LoadLevel(0);
    28.                     m_GameState = GameStates.GAME;
    29.                     m_guiName.active = false;
    30.                 }
    31.  
    So I've been thinking of a way to limit the number of characters and thought that the best way to be to call PlayerPrefs.SetString("sb_result", validString); but it doesnt actually change the actual string the keyboard is working with. Backspace works fine except after I go over 10 characters.

    For example: If my string is "0123456789" (10 chars) and i press backspace its fine and my GUIText shows the correct string. If i were to add another 9 to it "01234567899", my GUIText will still show "0123456789" but the string that the keyboard sees is "01234567899". Now if I were to touch Backspace(once) my GUIText wouldn't change at all but the string the keyboard is working with does change. If i were to touch it twice, then the '9' on the GUIText would be erased. Sorry if I'm not explaining it clearly. Any ideas as to how I can get around this? Thanks.
     
  36. ader

    ader

    Joined:
    Jan 27, 2009
    Posts:
    155
    You could record an array of keypresses that occur after the limit is reached, and use the length of this as an index to get the correct char string from the keyboard output? Obviously pressing delete would pop the last entry out of the array.

    edit: I just realised that you will be seeing the full keyboard string so the above wouldn't help with that bit of your conundrum :(
     
  37. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    I think you should do this in the obj-c side:

    Code (csharp):
    1. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
    2. {
    3.     DebugLog(@"textField:shouldChangeTextInRange:replacementText: %@ (%i, %i)", string, range.location, range.length);
    4.     if (range.length == 1) // this means the user is deleting chars
    5.         [self sendUnityResultString: [NSString stringWithFormat: @"keystroke|%@", [textField.text stringByReplacingCharactersInRange: range withString:@""]]];
    6.     else {
    7.         if ([textField.text length] >= MAX_CHARS) return NO;
    8.                 [self sendUnityResultString: [NSString stringWithFormat: @"keystroke|%@%@", textField.text, string]];
    9.     }
    10.     return YES;
    11. }
    12.  
    That's untested code from the top of my head, but the general idea is, if you've got more than max chars in the field, don't accept new input.
     
  38. LeeHickey

    LeeHickey

    Joined:
    Apr 8, 2009
    Posts:
    25
    Is anybody successfully using the enhancement pack with 1.1 beta 4? I bought the pack yesterday and it worked fine with 1.0.3. I then upgraded to 1.1 b4 because of a texture alpha problem I was having, commented out the appropriate lines in AppController+additions.mm:

    Code (csharp):
    1.  
    2. AudioSessionInitialize (NULL,NULL,NULL,NULL);
    3. UInt32    sessionCategory = kAudioSessionCategory_AmbientSound;
    4. AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,
    5. sizeof(sessionCategory), &sessionCategory);
    6. AudioSessionSetActive(YES);
    7.  
    and it crashes at startup, throwing a "EXC_BAD_ACCESS". I narrowed it down to a call to UnitySetAudioSessionActive(true)
    in AppController.mm.
     
  39. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Don't talk about fight club. Or Tom will get mad at us.

    Please use the appropriate forum for discussing 1.1 beta issues. I believe there's a mailing list or something. Also, you can contact me directly (robterrell@gmail.com) for EP issues with 1.1 betas.
     
  40. LeeHickey

    LeeHickey

    Joined:
    Apr 8, 2009
    Posts:
    25
    Ooops. Well, it is not to do with the beta per se but with the enhancement pack. I sent a mail to support@stinkbot.com yesterday but I'll forward it to the mail you just gave.
     
  41. HMachuca

    HMachuca

    Joined:
    May 4, 2009
    Posts:
    36
    Thanks bliprob! Works perfectly.
     
  42. billchan

    billchan

    Joined:
    Mar 23, 2009
    Posts:
    4
    Hi,
    My project manager wants to invert app display(home button at top, but the app still looks at normal orientation). but rotate the camera does not change the GUIText and GUITexture.

    Any simple method other then coding again with GUILayers?

    I found the following code in the AppController+additions.mm.
    // This doesn't seem to work, but it was worth a shot

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
    }

    Thx!!
     
  43. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    That's not really an enhancement pack question, but sure, you can do that:

    Code (csharp):
    1. function Start () {
    2.     iPhoneSettings.screenOrientation = iPhoneScreenOrientation.PortraitUpsideDown;
    3. }
    You can't do it from Objective-C, because Unity creates an EAGLView in portrait orientation (i.e. 320 x 480). The OS always seems to think it's in portrait orientation. When the enhancement draws windows in landscape orientation, it has to place them at portrait coordinates and then rotate them to landscape.
     
  44. nikko

    nikko

    Joined:
    Mar 20, 2009
    Posts:
    436
    I've purchased the enhancement pack today:
    1 - good news : itis great, integrates and install in a snap : good job!
    2 - bad news : it does not work.

    I use 1.1 release candidate RC1

    I've been careful to follow the instructions (hard to do an error it is so simple) and use the Build button (not build and run)

    When I compile I get 10 warnings.
    When I Install and Run the Appp I get "EXC_BAD_ACCESS" on the first splash screen before the second splash screen happens.

    When I debug, I see the crash at
    Code (csharp):
    1.  
    2. 0x0062aa60  <+0196>  ldr    r3, [sp, #4]
    3. 0x0062aa64  <+0200>  cmp    r3, #0  ; 0x0
    4. 0x0062aa68  <+0204>  strbne sl, [r5]
    5. 0x0062aa6c  <+0208>  bne    0x62aa74 <_Z29SoundEngine_StartAudioSessionb+216>
    6. 0x0062aa70  <+0212>  mov    r6, #1  ; 0x1
    7. 0x0062aa74  <+0216>  bl 0x5b33a8 <_Z17GetPlayerSettingsv>
    8. [b]0x0062aa78  <+0220>  ldrb    r3, [r0, #64][/b] // HERE IS THE CRASH
    9. 0x0062aa7c  <+0224>  cmp    r3, #0  ; 0x0
    10. 0x0062aa80  <+0228>  beq    0x62aa9c <_Z29SoundEngine_StartAudioSessionb+256>
    11. 0x0062aa84  <+0232>  ldr    r3, [pc, #412]  ; 0x62ac28 <_Z29SoundEngine_StartAudioSessionb+652>
    12. 0x0062aa88  <+0236>  mov    r2, #0  ; 0x0
    13. 0x0062aa8c  <+0240>  add    r3, pc, r3
    14.  
    so my guess is that, because Unity 1.1 has a function to not interrupt the music, it may interfere with the same one in the Expansion Pack?

    What can I do now?
     

    Attached Files:

  45. bliprob

    bliprob

    Joined:
    May 13, 2007
    Posts:
    901
    Nikko, email me and I can help out.
     
  46. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    576
    I've been poking around with the photo picker lately. Really cool stuff. However, in my project the object receiving the texture is the same aspect ratio as the native images before they get resized into squares. This works just fine for horizontal photos, but the vertical images get really stretched. Would there be a simple way to determine the image's orientation on selection and rotate it so that the length is always wider than the height?
     
  47. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    576
    Perhaps some images would better illustrate my issue.

    Say I have a picture like so:


    When the photo picker gets a hold of it, the image is converted to a square. Once in game, it applies the square texture to a playing field which is oriented horizontal. This causes massive stretching:



    What I'm looking for is a way to determine portrait-oriented photos on import and have the picker rotate them 90 degrees before converting to square and importing so that they turn out applied like this:

     
  48. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    People, I'm behind on this thread but all of you discussing pre-release beta builds of Unity iPhone are going to find your way out of any future access to such things if you keep posting about it. :)


    Do not discuss pre-release builds in public!
     
  49. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    576
    Photo orientation? Anyone? Anyone? Bueller?
     
  50. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    how about just material orientation instead of trying to make it complicated? :)