Unity Android – First impressions

Well, yesterday I coughed up $3000 for Unity Android Pro. The idea is to make games and sell them – hopefully.

I’d started on a game idea already – still at a prototyping phase – so I had a project ready to get up and running.

I’ve written Android apps before, using Eclipse, and I’m used to Unity (it’s what I use at work). Putting the two together was an interesting experience, though not nearly as painful as some other game-dev setups I’ve had to go through.

A few thoughts so far:

Once you’ve got Unity installed, and the Android SDK installed and setup (that’s not simple, but thankfully I already did it months ago and so was spared), Unity is set up to let you build and run with a few clicks. Well, unless you’re like me and insist on being difficult. I want access to the Manifest and the Java code that launches the app (so I can put up a dialog first). This means integrating with Eclipse. Thankfully, instructions are provided on how to do this. Basically, it means having two projects: One (built from an empty Unity project) that contains the Unity framework and is imported by Eclipse as a library, and another that contains all your game assets.

Anytime the Unity project is built, the assets must be copied over to the Eclipse one. I highly recommend making a build script for Unity that does this, or it gets tedious very quickly. Before running, you still have to touch one of the project files in Eclipse to force it to rebuild the assets.

The build settings should be the same across both Unity projects, or some things don’t work. I spent ages trying to get a landscape view and gles 2.0 to work only to have it turn out to be a settings mismatch.

OpenGL ES 2.0 means no emulator. Nothing to do with Unity, I just hadn’t realised until now.

Input is easy, though the docs are light on the subject of buttons and I had to resort to Google. The Menu button is mapped to KeyCode.Menu and the back button to KeyCode.Escape.

I’m going to want access to Android’s SharedPreferences class, and to the system Locale information, but I don’t think Unity is going to give them to me. I’ll have to investigate ways around this.

As far as the project goes, rendering optimisations are going to have to be harsher than I planned, but not heartbreakingly so. Most of my experience in this area has been with DirectX on PC, so I’m still learning where the performance pitfalls are.

All in all, it’s going well and I’m happy with it. Maybe the game will show up here soon 🙂

This entry was posted in Programming.
Tags: , , .
Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *