Search Unity

More docs & sample code for managing a mobile product and plugins

Discussion in 'Documentation' started by seaders, Dec 16, 2014.

  1. seaders

    seaders

    Joined:
    Oct 28, 2014
    Posts:
    29
    We're a small team who are now making our first two games in Unity, after creating our last two in Adobe AIR. For 90% of what we're doing in Unity, it really has been a definite improvement, *specifically* to do with game coding and creation, but when you go into platform specifics (which is my role / area of expertise), I honestly think there's a dearth of documentation that should needs to be addressed.

    The reason I feel this way is due to the last few weeks of bringing device specific features to our games, like Analytics, In-App Purchases, Push Notifications and Social Login. We've bought a few plugins (Analytics & Social Login), and we've brought in some open source (OpenIAB), but we also want to be able to develop in house, so that's what's happening with Notifications on Android.

    One huge thing that I've struggled greatly with is purely and simply debugging. On Android, after a HTML callback, trying to evaluate the response in the bugger, force crash. On iOS, launching normally (via XCode), but then trying to connect with MonoDevelop, XCode crash, and app crash on the device. Connecting to the debugger on Android from MonoDevelop on iOS, do I choose iPhonePlayer (that I assume is over WiFi?), do I choose one of the *two* unityproxy options, or USB? On Android, it's nearly just a wish and a prayer whether it connects, or not, and whether it crashes, or not. As a newcomer to this area, I really do feel the information for here is incredibly lacking, and if you ask over at MonoDevelop, they won't help at all because of the changes made to MonoDevelop to run with Unity.

    Then there's the management and structure of a mobile project. Best practise to build Android from Unity, or from an exported Eclipse project? Best practise to replace or append for iOS? Best practise to have .m files in /Assets/Plugins/iOS or in the exported XCode project? Best practise for the C# layer to differentiate whether you're on the emulator, iOS or Android?

    What's pushed me to make this post was basically I was reading through open source projects to try and figure out what they were doing, and then mimicking that, but realistically, this sort of information should be coming from Unity themselves. Even the very first part of the docs "Using Your Plugin from C" is, I feel, inadequate. Which file should this be? Where should it live? Where does "PluginName" come from?

    As an example of what we had with AIR,
    http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt1.html
    (4-part devnet article, with accompanying https://github.com/nweber/SystemVolumeNativeExtension project),
    http://gotoandlearn.com/play.php?id=148
    (2-part video tutorial, accompanied by http://gotoandlearn.com/files/ane2.zip project files)

    And a lot, lot, lot more.

    What I'd *love* to come from Unity officially is something similar. A full tutorial, with video, and advice, and GitHub project, dealing with a multi platform plugin (both Android & iOS would be great) where all this is dealt with, along with things like the UnityPlayerProxyActivity on Android and sending messages from the native side, and receiving them on the Unity one.

    I do think it'd help the community greatly.
     

    Attached Files:

  2. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
    I sympathise certainly, this is an area of Unity which needs improvement. I guess at lot of the problem is in the Android side of things, setting up Android debugging can be a bit of a nightmare. Hopefully some of my colleagues who have successfully set up an Android debugging environment will be able to comment.

    Personally I haven't used Eclipse myself.

    I think this is the only area where I disagree, because I think this page actually looks quite clear:
    http://docs.unity3d.com/Manual/PluginsForAndroid.html

    Ideally yes I agree, although the market is wide open for user-generated content in that area. I wouldn't necessarily say that tutorials and best practices necessarily have to come from inside the company, although of course it would be great if they did. There are some excellent resources from people outside the company.

    But I have mentioned it to Will Goldstone, maybe his team will be able to do a tutorial on this.

    Also I understand you were chatting to Levi on IRC and he had some advice on these subjects?
     
  3. seaders

    seaders

    Joined:
    Oct 28, 2014
    Posts:
    29
    Hi Dave,

    Many thanks for the reply, 'tis always appreciated.

    Last thing first, I was chatting to a few folks on IRC, mainly about the issues with debugging an iOS project actually, not Android. I was building and running directly from Unity, but as soon as I connected to the USB debugger from MonoDevelop (which again, I feel there's not enough documentation on this "select Run > Attach To Process from the menu in MonoDevelop and then select the Unity application from the list of processes that appears" doesn't hint at which is right between iPhonePlayer, unityproxy, or USB), the app, and XCode crashes. Apparently it's well known that you shouldn't have the XCode debugger connected when trying to connect the MonoDevelop debugger. I can't see anything along those lines in the docs, which kinda started me along this path.

    As for the Android debugging stuff, I got that working before I got iOS working, because that fella just completely crashed out any time I went near it. It's moreso about the complete file structure, and specifically sample code.

    More docs, with sample code places,

    iOS - https://developer.apple.com/library/ios/samplecode/SysSound/Listings/ReadMe_txt.html (Download sample code button)
    Android - https://code.google.com/p/gcm/source/checkout

    Adobe AIR was free, we paid for the IDE for it, but the SDK and producing IPAs & APKs was free. But the docs for these areas were incredibly good, thorough, and directly from the company. There were plenty of problems (obviously... otherwise we wouldn't have switched to Unity...), but the amount of sample code, and dev articles to support people extending what they had already given you were incredibly good. We're going to be spending a lot more money on Unity Pro, and for you to say that best practises, and adequate documentation, and source code doesn't need to come from you, I really don't think is fair.

    Realistically, the video tutorials are just sauce on top, but real 'n proper source code to accompany some of these areas are pretty much vital to fully doc what's happening, and where things are supposed to go.

    For me, from where I am, and the experience I've got, the main one I'd love is a full 'n proper project with both Android and iOS native arms (like https://github.com/onepf/OpenIAB-Unity-Plugin have done, for instance). Because honestly, I've now 4 years of mobile development and releasing apps behind me, but I really do feel I get dropped off a cliff from the documentation you give when you go a little bit outside of specifically the Unity GUI, even MonoDevelop. And would love a bit more support and documentation directly from Unity, rather than having to go and bug the (very, very good) community.