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. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bakno, I have a possible fix for the rotation issue where the ad is only touchable on the left side. I was hoping Apple would fix their bug for iOS 4.2 but it doesn't look like they did. If you want to test it out, shoot me an email and I'll send you over the updated package.
     
  2. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    Sure Prime31. I am interested in testing it. My email address is andres at bakno.com.

    I sent you an email through the contact form on your site but I am not sure if it will reach you.
     
    Last edited: Dec 13, 2010
  3. murali.vvn

    murali.vvn

    Joined:
    Jun 28, 2010
    Posts:
    53
    I am using bellow methods in MobclixManager.mm.

    Code (csharp):
    1.  
    2. - (BOOL)adView:(MobclixAdView*)adView shouldHandleSuballocationRequest:(MCAdsSuballocationType)suballocationType{
    3.     return NO;
    4. }
    5.  
    6. /* If you wish to use AdMob, enter your AdMob publisher key below and you will need to manually
    7.    include the AdMob library and framework dependencies.  Also be sure to uncomment this method.*/
    8. - (NSString*)adView:(MobclixAdView*)adView publisherKeyForSuballocationRequest:(MCAdsSuballocationType)suballocationType
    9. {
    10.     // AdMob integration
    11.     if( suballocationType == kMCAdsSuballocationAdMob )
    12.         return @"MY ADMOB KEY";
    13.     return nil;
    14. }
    15.  
    Now I am getting add form MobClix, not form AddMob, I think its a test add (black or white background with "mobclix" text). How to get adds form AddMob?, Is there any way to get adds only form AddMob?.
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    You will have to check with Mobclix for the details of their sub allocation system.
     
  5. T-Strijker

    T-Strijker

    Joined:
    Apr 12, 2010
    Posts:
    26
    Hey Prime31

    A few weeks back we bought the gyro plug-in DeviceMotion for our game. I get the plug-in to work fine on the iphone4. But after a little while or when you start multitasking whit the iphone. The center point (where the qyro sent's a zero Quaternion back) the gyro reset its self or someting and every things works at a different angel. This leads to a problem that you have to control the game at an angel that you can't see whats on the iphone display.

    Do you have any idea how I can make sure that the center point of the gyro doesnt change in the scene. The controls script are written in javascript. I got it to work whit the C# code by adding the DeviceMotion scipt in to the Standard Assets folder and not the input folder. But i thinking that this cut be the problem to this error.

    Code (csharp):
    1.  
    2. function SetGyroscope()
    3. {
    4.     DeviceMotionBinding.start();
    5.     DeviceMotionBinding.setInterval( 1 / 60 );
    6. }
    7.  
    8. function FixedUpdate()
    9. {
    10.   ....
    11.          var gyroQuaternion : Quaternion = DeviceMotionBinding.getNormalizedQuarternion();
    12.     gyroVector = Vector3.zero;
    13.     var flt : float = 0.0f;
    14.         gyroQuaternion.ToAngleAxis(flt, gyroVector);
    15.     gyroVector *= flt / 90;
    16. }
    17.  
    18.  
     
    Last edited: Nov 26, 2010
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @T-Strijker, I would suggest trying two things and seeing which works best for you:

    1. When your app is backgrounded, call stop to turn off the gyro then call start to turn it back on when resuming
    2. Try calling the reset method to reset the centerpoint of the gyro
     
  7. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Hi Prime31,

    Thanks for great support!

    My problem now is rotate a camera with gyro data to show a panoramic texture in a skybox. The iPhone is in landscape mode and the quaternion returned by getNormalizedQuaternion() is not working with mainCamera.transform.Rotation.. The axis are incorrect and the movement is not smooth like we seen in your sample.
    You have any tips or samples in this situation? A skybox with a panoramic image and a camera attached to gyro?

    Thanks,

    Jose
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Jose, try flipping the x and y axis. That should get you started for landscape. From there, you may want to multiply the y axis by -1 depending on how you want the controls to behave.
     
  9. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Yes, but HOW i do that? I need create a new quartenion or something?
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @stairs, you will need to create a new Quaternion with the old values just multiplying the y axis by -1.
     
  11. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    something like: Camera.mainCamera.transform.rotation = new Quaternion(gyroData.y,-1*gyroData.x,gyroData.z,gyroData.w) ? I try this, but the rotation axis still wrong..when i tilt to left/right i get a ratotation in z-axis!

    Man..how this quaternion works after all??
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Try giving the attached PDF a read. It has some good info explaining quaternions.
     

    Attached Files:

  13. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Thanks, but a question: What's the diference between getRawGyroData() and getNormalizedQuarternion(). What means a 'normalized quaternion"?
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @stairs, raw gyro data is the velocity of the gyro in real time where as getNormalizedQuarternion is the current orientation of the gyro.
     
  15. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Ok..it's working now! Thanks!... Best support ever...
     
  16. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    With the Media Player is it possible to get metering data like the audio player but from your iTunes tracks? Thanks.
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @mehware, you don't get the kind of control when working with iPod tracks. All you can do is what is available here.
     
  18. T-Strijker

    T-Strijker

    Joined:
    Apr 12, 2010
    Posts:
    26
    Thx for your fast replay.
    I tried your answers and they do work, but i still have a problem that the centerpoint is not set at a fixed point. This lead to problem that when the game starts or returns form the home screen while playing the centerpoint changes. Is there some why to have fixed centerpoint just like the accelerometer has.
     
  19. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Last edited: Dec 1, 2010
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @T-Strijker, you can either manage the center point yourself and set it however you would like then do the translations manually or call reset to recalibrate the center point.

    @stairs, it looks like you have a permission issue (??) perhaps somewhere. I would try rebooting my computer. If that doesn't work, reinstall Unity.
     
  21. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    I try reinstall Unity but not work...anything else?
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @stairs, perhaps try using Disk Utility to repair permissions.
     
  23. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Same error :( But why this happens only using your plug-in?
     
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @stairs, when you remove the plugin do you still get the error? The error you are getting definitely appears to be permissions issue with Xcode/Unity. The plugin does not modify permissions or add resources to the data bundle.
     
  25. stairs

    stairs

    Joined:
    Nov 19, 2010
    Posts:
    18
    Yes..when i remove the plugin, i can compile and run! Everything works fine until yesterday..when i update to the new Unity...
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @stairs, try redownloading the plugin and see if that does the trick. Perhaps the files were retaining a permission they shouldn't have had.
     
  27. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    Prime31,

    I have a heavy and critical problem here, I post it on the forum for other users to see it, as they may encounter the same problem.

    This may be a newbie installation problem.
    Note that I have already completed releases with Unity and Unity + iPhone in the past, have a pro licence, etc.

    Let's call my Project "DemoProject".

    So, I tried the Social Networking plugin and the Etcetera plugin with the following steps:
    1. Creating empty project, and importing package.
    2. Copying the Assets folder into DemoProject's Assets.
    3. I do the same for Etcetera then Social Networking.

    Unfortunately, the scenes didn't work (said Mono was missing when trying any testSupport scenes), so I tried:
    4. Deleted all folders received from steps 2.
    5. Imported package Social Networking right into DemoProject.
    6. Imported package Etcetera right into DemoProject.

    At this step, I have a working Unity application. The testSupport scenes were working.
    Well, unable to login to Facebook (nothing displayed when I click on the "Login" button from Social networking scene #1, for instance), but launching at least.

    So I tried:
    7. Build only the test support scenes (the ones for Social Networking and Etcetera) to Xcode.

    I was careful to click only on Build.
    I received the Finder's "everything OK" message for Social Networking, then received the "everything OK" message for Etcetera.

    I then tried:
    8. Build project on Xcode.

    This same project was working with my code, code signing seems OK and I have been checking and trying various things for source and target. There is only your scenes loaded in the project.

    When building, it generates no less than 13980 errors and 361 warnings.
    Needless to say it's not working.
    I am using Unity 3.0 pro.

    An example of error is:
    #include <dispatch.h>
    -----> Dispatch/dispatch.h : No such file or directory

    Others are like :
    Expected ) before ms
    Expected ) before local


    And so on...

    So, please help, a step by step process would be just fine.
    I am sending you also en email right away, to get even more attention ;-)




    ...
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Aekar, with 13,000+ errors there is definitely something very wrong with your Xcode project. The error you mention (Dispatch/dispatch.h) is also of particular concern because that is a missing file that is not part of the plugins. You are doing the steps correctly but something about the project Unity created is not right. For a quick video tutorial of setting up a project check out the video on the top of this page. Are you setting up your Base SDK to 4.2? I can't image that would be the issue with missing Unity required files but it cant hurt to check.
     
  29. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    I was thinking the same, but was unsure of it.
    Upgrading Unity to 3.1 and upgrading the iPhone to 4.2 (from 4.0) worked indeed.

    Thank you for your support :)
     
  30. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    There is a new problem I have.

    While working with the Etcetera plugin, I noticed there are "alerts" which raise events I must catch.
    Problem is, I am working in Unity Javascript, not C#, and I need to catch the events there.

    This should be possible but I have a problem setting up the correct way to do it.
    I tried things like addEventListener and the like

    After using this:
    EtceteraBinding.showAlertWithTitleMessageAndButtons( questionText, infoText, "Yes", "No");

    The best result I had so far was some sort of
    "Event alertButtonClicked can only be triggered from within its declaring type"


    I need to catch the alert result.
    I would have loved static variables instead of events.

    There is a "EtceteraManager.alertButtonClicked" to place somehow after this, but I'm sure that the best way to get me started should be an example of how I would catch whether the user clicked on Yes or No, in javascript, since you surely know how I should do this.It's just that catching Events from C to Javascript seems a bit tedious at first, and I cannot use most of Etcetera functions without figuring out this.
     
  31. dannyflint

    dannyflint

    Joined:
    Mar 12, 2010
    Posts:
    28
    Hi Prime,

    Could you possibly take a quick look at my forum post. I have repeated the text here and will request to have the other post deleted if you prefer to answer here.
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    I have the mobclix plugin - downloaded a few days ago. My game is designed to always be landscape left and no matter what I do I can't get the banner to sit at the top of the screen in landscape ( it always stays to the left - so a sideways ad if you like ). I've tried combinations of all the plugin options but the only other thing I've been able to get it to do is swap sides. It never rotates with my game any advice would be appreciated.
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Thanks
     
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dannyflint, are you using the prefab that comes with the plugin? That will handle the placement and rotation of the ads for you.
     
  33. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Hi Prime31,

    I've just downloaded the latest version of the Moblix plugin before submitting my app. I noticed in the documentation page that you have added Admob suballocation requests. It is a good job I checked as I had not realised I had to treat them differently. Looking at the Mobclix site, I noticed there is also suballocation for Google and iAd. Will the suballocation for these 2 also work? Is there anything else I need to do? iAd in particular is important.
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Moonjump, iAds will work with no modification needed. I am not sure about Google though. I was never able to get Mobclix to send a Google suballocation request so I am guessing it doesn't work.
     
  35. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Thanks Prime31, I'll disable Google to be on the safe side.

    One other question that you, or one of your users may be able to help with. I have seen reports that iAd needs a 2 minute refresh time, but others only 30 seconds. Is this right? If so, can you get away with 30 seconds, but be punished by Apple in some way, such as fill-rates?
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Moonjump, you have no control over iAds refresh time so you don't have to worry much about it.
     
  37. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Thanks Prime31,

    I was just wondering if it would be better to change the overall refresh time to 2 minutes if targeting iAd.
     
  38. byerdelen

    byerdelen

    Joined:
    Mar 27, 2010
    Posts:
    68
    Hi Prime31,
    I checked my issue everywhere but I couldn't find an answer so if you answered it before, sorry for asking again.
    I bought 3 plugins so far and now I want to buy mobclix plugin because I am not happy with Iad fillrate.
    So my question is, on the plugin it writes mobclix with admob support, as I checked admob is natively supported by mobclix as I see from account in mobclix. So it means that they are not natively supporting really and in your plugin you have the admob sdk installed?
    And mobclix tell that Iad is also supported natively, it means I will integrate your plugin and Iads will appear directly according to my settings in mobclix? I'm nearly done with my update of my game and appreciate a good answer and buy your plugin as well.
    Thanks alot Prime31!

    Just people to know, according to my experience Iad has perfect ecpm(mine is around 20$), but very low fillrate if you make a game (mine is around %2,75). For an international game(non-specific region) like mine, the iad supporting countries(U.S., U.K., France) is less(mine is around %30 of worldwide). In 2 months, till january Iad will add some important countries such as Japan and Germany but still not enough. So the best profit way is using Adwhirl(i found it hard to setup itself and ad sdk's) or using mobclix(Prime31's plugin seems handle all the jobs according to the posts I read). Setting up priority settings as Iad first, mobclix ads second and admob as third will at least double my profit when my fillrate is around %100, while iad is not showing up then others appear. This is what I searched from many charts of people and mine. Hope it will give some idea to others and be helpful.
    Cheers from Hairy King Studios!
     
    Last edited: Dec 5, 2010
  39. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    Dear Prime31,

    Maybe you did not see my second reply as it was with the same name.

    I need an example of how to catch the alert raised by the Etcetera plugin.
    I will just quote myself here: (I edited the quote to make it more readable)



    Thank you very much,

    - Chris
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @byerdelen, The Mobclox Plugin can serve iAds and Admob ads by what they term suballocation. The plugin will add the Admob SDK files to your project if you choose to support Admob ads. The Mobclox portal can then be used to manage the allocation.
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Chris, event listening is 100% identical in JavaScript and C#. The C# examples can be copy/pasted directly. For example:


    EtceteraManager.someCoolEvent += someListenerFunction;

    void someListenerFunction( result )
    {}
     
  42. dannyflint

    dannyflint

    Joined:
    Mar 12, 2010
    Posts:
    28
    It's strange. Since updating the plugin ( or it might have happened before - I didnt notice ):

    If I start my game ( title screen - Level0) with phone landscape left then the banner stays sideways on the side in the wrong position.

    However If I flip it over to landscape right then the game flips and the banner goes to the right place ( top of landscape ). Also if i then flip it back to landscape left then it does what its supposed to too.

    When I start my game ( Level1) the banner stays whatever position it was in before you press start game, and the game is no longer flippable.

    Danny
     
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dannyflint, it sounds like the prefab isn't making it through the scene load. Double check that it is set to not destroy on load. I believe there was someone who contacted me with a similar issue where dont don't destroy was still killing off game objects on scene load.
     
  44. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    As far as I can see this is not supportetd for the askForReview Method, there are no stringholders for the button titles in this function. The buttons have only english titles.
     
  45. byerdelen

    byerdelen

    Joined:
    Mar 27, 2010
    Posts:
    68
    Hi Prime31,
    Thanks for your answer before, now I have another problem with Admob in Mobclix. If I dont use Admob in Mobclix it works fine with Iad too but if I enable Admob from mobclix site, the first ad from Admob appears without problem. But when mobclix rolls the ad and tries to change the ad after 15 seconds, there is a crash. I use your latest plugin and I haven't changed any codes at all, also I checked the weak links from many sites and they look all in order. Also no problem if Abmob enabled from Unity and the sdk is installed, the problem when I mobclix shows the first admob ad and after tries to change. The others working fine with admob.
    So it is the crash reason from the debug:
    Program received signal: “EXC_BAD_ACCESS”.
    warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
    Can you check it?
    Thanks in advance
     
  46. byerdelen

    byerdelen

    Joined:
    Mar 27, 2010
    Posts:
    68
    Hi again Prime31,
    I was checking things in admob setting and found the problem: In App settings of Admob account, I was using Automatic Refresh as custom and before Admob was not crashing. But with the plugin, it made the problem so I simply changed the Automatic Refresh as "Use refresh rate set in client code" and that fixed the problem.
    I didn't erase my post in case somebody will have the same issue and can find this post.
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @synapsemessage, it sure is supported:

    // from the prompt:
    cancelButtonTitle:NSLocalizedString( @"Remind me later", nil )
    otherButtonTitles:NSLocalizedString( @"Yes, rate it!", nil ), NSLocalizedString( @"Don't ask again", nil )
     
  48. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    What I meant with "not supported" is askForReview being handeled a bit differently compared to showAlertWithTitleMessageAndButtons, where I have access to button titles. As I'm a null with objectif c, does the given code snippet belong into MainWindo.xib? Maybe you could give a small example how to do it? A small template? Looking up Apple Docs didn't shed enough light into it.
     
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @syanpsemassage, have a look at this tutorial or just Google "NSLocalizedString iOS" for tons of resources. You don't need to write a single line of Obj-C to use localized strings.
     
  50. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    Yes works now, great! It's as easy as you say, but you have to erase the unnecessary "tutorial content" from your brain before it becomes that easy ;-)

    Summary:
    1. In your open xcode project select the MainWindow.xib and "get info". Make it localizable. Add languages (en, de, fr, ja, es, etc.)(http://www.sub.uni-goettingen.de/ssgfi/projekt/doku/sprachcode.html)
    Thenafter, in your project directory you will find new directories( en.lproj, de.lproj, etc.) in the Classes folder. Keep the default English.lproj folder, too and grab/copy the Localizable.strings from en.lproj.

    2. Create text file for each language, name it Localizable.strings (see syntax below). The file ending ".strings" is important (it's ".strings" not ".string"). These files must be character-encoded in Unicode (UTF-16)! Copy these files to appropriate folders. Then drag-drop .strings into your open xcode project. In the dialogue-popup mark UTF-16 (and eg. "relative to enclosing group")

    3. Etcetera Plugin code that uses "NSLocalizedString" grabs the correct strings (correct language) automatically. For the other stuff use myVariableToBeLoadedWithALocalizedString = getLocalizedString( string key, string defaultValue )

    Localizable.strings (en):
    /* some buttontitle */
    "continue" = "continue";

    /* Error string used for unknown error types. */
    "ErrorString" = "A terrible error occurred.";

    Localizable.strings (de):
    /* some buttontitle */
    "continue" = "weiter";

    /* Error string used for unknown error types. */
    "ErrorString" = "Es gab einen schrecklichen Fehler";
     
    Last edited: Dec 8, 2010
Thread Status:
Not open for further replies.