Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Prime31 Unity Plugins Officially Live! [CLOSED]

Discussion in 'iOS and tvOS' started by prime31, Aug 27, 2010.

Thread Status:
Not open for further replies.
  1. Matkins

    Matkins

    Joined:
    Aug 24, 2009
    Posts:
    152
    Thanks Prime. Rolled back to Xcode 3 and made the PostprocessbuildPlayer an executable and everything's working fine. Cheers!
     
  2. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Does this mean that I can only use XCode 3? I don't have XCode 3, so does that mean I should download and install it? If I do, do I have to redo all my certs, and stuff?

    Gigiwoo.
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gigiwoo, check your PMs.
     
  4. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Prime31,

    Thanks for the help. Working great now.

    Dumb follow-up questions. When I spawn a view controller, is it possible to have it just cover part of the screen? I assume Unity3D is controlling the whole 'window', and that the view controllers are just sitting on top of the underlying unity3d display. What I'd like to do is use the Native kit to create an interface that is just a portion of the screen, where Unity is running in the background, etc. Maybe even see through it. So the user presses a button and a menu slides out with options, where the menu is really a standard IOS view.

    This is easy-dumb stuff, I'm sure. I couldn't find an easy way to resize the view or window that is part of the Native Toolkit directory in XCode.

    Thanks,
    Gigiwoo.
     
  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gigiwoo, you can always set the background color of your view controllers view to clear to be able to see through it. For your case you will need to adjust it's frame as well so that it isn't full screen. By default, view controllers views are always full screen and they will intercept all touches so you need to make yours smaller to let touches get through to Unity where appropriate.
     
  6. jacksonadams

    jacksonadams

    Joined:
    Apr 19, 2011
    Posts:
    2
    any reason why I'd be getting linking errors in XCode when trying to just use the CoreLocation and DeviceMotion plugin? Totally blank Unity project except for a camera with a skybox

    $Screen shot 2011-04-19 at 14.43.51.png

    XCode 3.2.5, SDK 4.2, Unity 3.30f4

    thank you!
     
  7. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jacksonadams, they should work fine together. It looks to me like the files aren't getting copied into your Xcode project by the post processing scripts. Are you doing the following:

    - making sure Xcode is closed when building from Unity
    - never using Build and Run from Unity (it will not work with plugins due to it not allowing the post process script to run). If you did use Build and Run be sure to do a Build followed by Replace to get a clean Xcode project.
    - building for the device. Plugins are not supported in the simulator
     
  8. jacksonadams

    jacksonadams

    Joined:
    Apr 19, 2011
    Posts:
    2
    wow thanks for the quick reply @prime31
    that was it ... I was doing "build and run"
    all set now. thanks!
     
  9. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Hi,
    I have problem with the latest SDK 4.3 and Xcode 4, when i try to build the game with device motion it give me the linker error. It work fine with old sdk 4.2 and XCode 3.2.5.

    Thanks

    Sunil
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gear, be sure to download the latest version of the plugin which has a new build system that works with Xcode 4.
     
  11. Matkins

    Matkins

    Joined:
    Aug 24, 2009
    Posts:
    152
    @Prime (or anyone else who knows)

    I've watched your video on Events and Delegates and I think i get the gist of it. But referring specifically to the "alertButtonClicked" event in the Etcetera plugin, is it true that although I can get the string on the button that was clicked there's no way of telling which alert it has come from? I could be using alerts in a number of different situations in the game, and the button strings "yes" and "no" could be common over all of them.
     
  12. ForrestX

    ForrestX

    Joined:
    Apr 17, 2010
    Posts:
    94
    does anyone know how to post an image(not a link) to a user wall with a text(not a caption) and commenting it using Prime31+Facebook graph api call?
    Prime31 plugin allows only for image post+caption...

    I tried to read facebook graph api docs but it is a bit complicated for me :(
    and I don't know how to retrieve the Object_ID of the image to make operations on.

    thnx
     
    Last edited: Apr 20, 2011
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Matkins, this is a good example of when a tiny little state machine could help out using a simple enum. Something like the following should do well:


    Code (csharp):
    1. public enum AlertType {GameStart, ButtonOnePressed, DidSomethingElse};
    then you can make a wrapper function for your alerts with a signature like so:

    Code (csharp):
    1. public static void showAlert( AlertType type, string title, string messsage, string buttonTitle )
    Your own showAlert method would just store the current AlertType that way your can have the event handler look like so:

    Code (csharp):
    1. void alertButtonClicked( string text )
    2. {
    3.     switch( currentAlertType )
    4.     {
    5.         // cases for the alert types here
    6.     }
    7. }
     
  14. mforsyth

    mforsyth

    Joined:
    Sep 29, 2010
    Posts:
    54
    for the first time I'm trying to build and run the Simulator and not on a device and I'm getting an error:
    mono_dl_register_symbol("_etceteraTakeScreenShot", (void*)_etceteraTakeScreenShot);
    /Users/mark/Project/Xcode/Libraries/RegisterMonoModules.cpp:73:0 /Users/mark/Project/Xcode/Libraries/RegisterMonoModules.cpp:73: error: 'mono_dl_register_symbol' was not declared in this scope

    I have just downloaded all the latest packages and built a new xcode build, did I miss a step?
     
  15. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @mforsyth, Unity doesn't support plugins in the simulator.
     
  16. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Thanks for help. With update package it work.
     
  17. 3dgrinder

    3dgrinder

    Joined:
    Oct 21, 2008
    Posts:
    249
    Hi Prime31

    We are facing an crash issue in GameKit. Here is the stack trace:

    Code (csharp):
    1. 2011-04-21 14:01:06.665 myApp[2925:307] -[__NSCFDictionary length]: unrecognized selector sent to instance 0x110c580
    2. 2011-04-21 14:01:06.781 myApp[2925:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary length]: unrecognized selector sent to instance 0x110c580''NSException'
    3.  
    From the error, it's seems: It's trying to access NSDictionary but getting crash due to some NSString.
    What I'm ensuring are:
    1. I have Single GameManager Prefab in the whole game flow and when my game is ending I'm calling InvalidateSession.
    2. I'm not forcing any device to make Server or Client.
    3. I'm registering delegate method OnEnable and unregistering OnDisable.
    4. After getting callbak from peerConnected, I'm doing some hand shaking to exchange data then game level load.

    When it's crashing:
    1. If Device1 announce the game and Device2 follow him, then 3-4 times it's running ok.
    2. If I mix that connection method or sometimes had some connection problem then probability high for crash.
    3. This crash happen when I press button to open the picker. I'm ensuring there is no PlayerPref function under this button action. It's just calling
    Code (csharp):
    1. GameKitBinding.showPeerPicker( isWiFi );
     
  18. macfinch

    macfinch

    Joined:
    Aug 24, 2010
    Posts:
    139
    Hi Prime. Thanks for all the advice so far with your plug-ins, awesome support.
    I have a question about the admob plug-in.

    When I tap on an admob ad and then click 'done' to finish seeing the ad, there's a moment where my game freezes and it won't take any input. After about 10 seconds it starts to register the taps. Have you come across this before, do you have a solution?

    Thanks again
    -M
     
  19. macfinch

    macfinch

    Joined:
    Aug 24, 2010
    Posts:
    139

    By the way, this is warning message I got from the console in XCode:

    <AdMob> Warning! Only the UIViewController's view can be attached to the window. Please fix your code by removing any calls to [window addSubview:] except for [window addSubview:myViewController.view].
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @grinder, none of the code in your crash log is from the plugin. In fact, there is NSUserDefaults code which is the backing store for PlayerPrefs. I would recommend reviewing your code for any and all calls to PlayerPrefs.

    @macfinch, 10 seconds is way too long. I usually see under a second when dismissing an ad. Does the demo scene have the same behavior for you?
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @macfinch, the warning is normal and due to the Unity keyboard view. It has no effects on banners and ads.
     
  22. macfinch

    macfinch

    Joined:
    Aug 24, 2010
    Posts:
    139
    Hey Prime, thanks for the reply. I'll give it a try and let you know.
    By the way, I'm using the iOS 4.2 SDK if that makes any difference?

    Thanks
    M
     
  23. 3dgrinder

    3dgrinder

    Joined:
    Oct 21, 2008
    Posts:
    249
    Thanks for your feedback. But thing is, we never even a single time didn't face crash issue in single player mode. It's only happen when we are in MM mode. I was thinking about thread safety. Anyway we are still looking for it.
     
  24. macfinch

    macfinch

    Joined:
    Aug 24, 2010
    Posts:
    139
    @Prime - It seems to go back to accepting input when the ad banner gets refreshed or is removed. The game then can accept input. Hope this gives you and idea.

    Thanks,
    M
     
  25. macfinch

    macfinch

    Joined:
    Aug 24, 2010
    Posts:
    139
    Hi Prime. I've just tested and the same problem occurs with the demo test scene which comes with the plug-in. I've sent over a video and some details to Mike at Prime31 (not sure if that's you :)).

    1) An admob ad appears
    2) I click on it and it takes me to the ad webpage
    3) I click 'done' which brings me back to my application
    4) The issue is that my application then doesn't register any input until the ad banner has been removed or refreshed. The attached video is an example. Sometimes the ad banner does not refresh for a long time which means users cannot interact with game.


    Please let me know if you can help.

    Thanks in advance
    -M
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Just a quick heads up: we just released the NectarSync Plugin! This is the feature that every mobile game needs: WiFi syncing of saved game state. With one line of code you can transfer all of your PlayerPrefs and the entire contents of the Documents directory from one iOS device to another. Start playing a game on the iPhone while on the go then just transfer the saved state to your iPad and continue right where you left off!
     
  27. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    ** Fixed i think**
    Basically it looks like its always looking at that onSuccessfulPurchase and i can't really change it.. so i made the title script have a check to see what level i was in and make the appropriate changes based on that.

    prime31,

    I have a storekit issue that i'm trying to resolve. basically we have 2 locations that we can purchase the "full" version of a game (essentially unlock it)... either on the title screen or in chapter02.

    Now i have this in the title screen main script..

    Code (csharp):
    1.  
    2.         public void Start()
    3.       {
    4.         if( !StoreKitBinding.canMakePayments() )
    5.         return;
    6.         // Listen for the event when a user purchases a product successfully
    7.         StoreKitManager.purchaseSuccessful += onPurchaseSuccessful;
    8.        }
    9.     public void purchaseFullGame()
    10.     {
    11.             if(PlayerPrefs.GetInt("gameversion") == 2)
    12.             {
    13.                 Debug.Log("Unlocking HD Game");
    14.                 StoreKitBinding.purchaseProduct( "com.bfg.nawpiaptesting", 1);
    15.             }
    16.            
    17.     }
    18.     public void onPurchaseSuccessful( string productIdentifier, string receipt, int quantity )
    19.     {
    20.         // Alright!  We got a sale!  Give them what they bought.
    21.         // Hide the buy now button
    22.         Debug.Log("We made a purchase!!!!!");
    23.         GameSave.FreemiumEnabled = false;
    24.         checkUpgradeStatus();
    25.     }
    26.  
    And that all works.. unlocks successfully and does what it needs to do.. i basically set a save state and unlock all the stuff i need to. Now i have the same exact basic function in chapter02 except its different as noted below..

    Code (csharp):
    1.  
    2.         public void Start()
    3.       {
    4.         if( !StoreKitBinding.canMakePayments() )
    5.         return;
    6.         // Listen for the event when a user purchases a product successfully
    7.         StoreKitManager.purchaseSuccessful += onPurchaseSuccessful;
    8.        }
    9.     public void purchaseFullGame()
    10.     {
    11.             if(PlayerPrefs.GetInt("gameversion") == 2)
    12.             {
    13.                 Debug.Log("Unlocking HD Game");
    14.                 StoreKitBinding.purchaseProduct( "com.bfg.nawpiaptesting", 1);
    15.             }
    16.            
    17.     }
    18.     public void onPurchaseSuccessful( string productIdentifier, string receipt, int quantity )
    19.     {
    20.         // Alright!  We got a sale!  Give them what they bought.
    21.         // Hide the buy now button
    22.         Debug.Log("We made a purchase!!!!!");
    23.         GameSave.FreemiumEnabled = false;
    24.         Application.LoadLevel("chapter03");
    25.     }
    26.  
    That code is in a completely seperate chapter02 script. now the problem i'm having is that when i do the purchase and it succeeds it not running the code for chapter02 but instead the code for title. I'm not sure what i'm missing here.. but any thoughts would be greatly appreciated.

    Cheers
    Bryan
     
    Last edited: Apr 29, 2011
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Bryan, without seeing all of your code and game object setup the first thing I would suggest is to remove event listeners when they are no longer needed:

    StoreKitManager.purchaseSuccessful -= onPurchaseSuccessful;

    Also be sure you only ever have a single StoreKitManager. That object is responsible for listening to calls from native back to Unity.
     
  29. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,149
    Hi prime,

    i have the same errors. i have ipad2, XCode 4.0.2 and the latest unity pro 3.0. i made PostprocessbuildPlayer* files executable. i use just build. what shall i do more?

     
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @atmuc, we sent off an update to the NativeToolkit Plugin a fee days ago that will add Xcode 4 support to the postprocess build system. You will know you have the update when you see a runner.py file next to the other post process scripts.
     
  31. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,149
    @prime i updated twice and imported to an empty project. there is no file like runner.py next to PostprocessBuildPlayer. should i delete it from local first?
     
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @atmuc, Unity is probably still reviewing the update.
     
  33. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,149
    @prime i got it. i had two folders under .......\Unity\Asset Store\Prime31 Studios\ Extensions and Scripting Packages. both folders had NativeToolkit - Unity to iOS Bridge.unitypackage. i think it was Extensions in the past now it is a scripting package. i deleted both folders downloaded again and imported to the project. now i have different sets of file in my project.
     
  34. qsm

    qsm

    Joined:
    May 1, 2011
    Posts:
    4
    I apologize if this was already mentioned in this thread, but how can I modify the prime[31] iAd plugin so that the ad is fixed in a single orientation? Or would this be a matter of just turning off the calls to the accelerometer all around?
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @qsm, if you are using the prefab just uncheck the boxes in the inspector for using landscape and portrait and it will remain in one location or don't use the prefab and it will never reorient in it's own.
     
  36. JohannChristoph

    JohannChristoph

    Joined:
    Jun 21, 2009
    Posts:
    141
    I'm having the same problem when building the App in Xcode 3.2.5 it says in a window: "Can't install application ... ... .app scecifies a CFBundleExecutable of ... , which doesn't exist". I use the Etcetera Plug In and it has problems with EAGLViewAdditions.

    i don't know how to make them executable. Whom? Where and How? i found files called "PostprocessBuildPlayer" and "PostprocessBuildPlayer_Etcetera" in the Editor folder. But i don't know what to do with them.

    On page 30 in this thread:
     
  37. Virtual

    Virtual

    Joined:
    Oct 30, 2010
    Posts:
    15
    hi i am trying to Serialize a game object using code as follows

    [Serializable()]
    public class TestNetworkPack {

    const int RotationSize = 4;
    const int PositionSize = 3;


    float []vectorPos = new float[PositionSize];
    float[] vectorRot = new float[RotationSize];
    string playerId;
    .....
    for the object i am trying to Serialize and
    MemoryStream stream = new MemoryStream();
    BinaryFormatter bin = new BinaryFormatter();
    try
    {
    bin.Serialize(stream,pack);
    }
    catch(Exception e)
    {
    Debug.Log(e.Message);
    Debug.Log("BROKE!!!!!!! PLayer");
    }
    stream.Position = 0;
    Byte[] testByte = stream.ToArray();
    string send = Convert.ToBase64String(testByte,0,testByte.Length);
    sendobj.show(send);
    GameCenterMultiplayerBinding.sendMessageToAllPeers("NetworkManager", "SecondPlayerUpdate", send, false);

    when i run the game on my iphone it displays my debug messages with the error mesage of

    (Filename: /Applications/buildAgent/work/6bc5f79e0a4296d6/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2505)

    now i have tried to use [System.Serializable()] .
    with no change i am out of ideas on what could be wrong :confused: as when i run it in the editor it works fine with no errors or it dosnt even show my debug message only when i build it and test it on the iphone.

    Any help you can give would be great

    Virtual
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Johanne, are you using the latest version of the plugin? Any issues due to CFBundleExecutable shouldn't have anything to do with a plugin. That is a compile/project setup/confit issue. The plugin cannot affect that.

    @Virtual, BinarySerialization uses reflection and isn't supported on the iPhone.
     
  39. JohannChristoph

    JohannChristoph

    Joined:
    Jun 21, 2009
    Posts:
    141
    @Prime31, ah i'm sorry. Stupid me :/ I still had set SDK version Latest (since 4.2) in the player Settings. Works perfect now, thanks Great Plug In!!!
     
  40. corey.stpierre

    corey.stpierre

    Joined:
    Nov 18, 2008
    Posts:
    79
    Prime31,

    I'm using the Moblix plugin, latest version, for Unity iPhone Advanced 1.7. Do you have an iPhone 1.7 compatible version of the PListEditor.cs file? The anonymous typing (use of var) is throwing errors all over the place because of the lack of .NET support. I know I need to upgrade to Unity 3, but I'll have to wait until this project ships.

    Thanks,

    Corey
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @correy, Unity 1.7?!?! Living in the stone age I see! Just delete the Prime31 folder and it should work for you, it isn't required.
     
  42. ssmchan

    ssmchan

    Joined:
    Nov 6, 2010
    Posts:
    72
    Dear Prime31,

    G'day!

    I interest on the "Media Player" Plugin and which can have the UI and let the user to control forward and backward the audio?

    For example I would like to make a program which the user select the audio by my UI and call you media player plugin to play the audio with the function control ( Play, Stop, Forward, backward )? Is it possible? Do you have example? Thanks..

    Regards,

    Simon.
     
    Last edited: May 3, 2011
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @ssmchan, you can do all that with the MediaPlayer Plugin. The sample scene included with it shows all that functionality and more.
     
  44. ssmchan

    ssmchan

    Joined:
    Nov 6, 2010
    Posts:
    72
    Dear Prime31,

    Great! Thanks for your quick response. I am now going to buy this plug-in... :)

    Regards,
    Simon.
     
  45. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31 I'm back! :) Quick question or issue i'm having on storekit. I updated yesterday to the latest plugins and all seems well but i'm unable to connect to the store any longer. I get the whole "Cannot connect to Itunes Store" issue. This is w/inapp purchases that worked previously. Did anything change functionally in the updated storekit?

    Cheers
    Bryan
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, nothing at all has changed in the StoreKit business logic for a loooooonng time. It is solid as a rock and used in a ton of apps. The problem most likely is that Apple's miserable sandbox server isn't functioning as planned. That is, of course assuming you followed the guidelines from the docs to the letter:

     
  47. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    ok yeah maybe it is apple. Who knows... it all used to work w/all the same id's. I'll give it a few hours and see. :)
     
  48. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    ... and now its working. Just like magic with absolutely no changes whatsoever.. we're back in business.
     
  49. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    @Prime31. Is there any way to get iPad iAds with the Mobclix plugin?

    It works fine on the iPhone, but doesn't appear to be an option on the iPad.
     
  50. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    See post in other thread, short answer not yet. Mobclix doesn't support them yet.
     
Thread Status:
Not open for further replies.