The Unity/Objective-C Divide

UPDATE: There was a typo in the code section that adds the observer for NSUserDefaults. This has now been corrected. I also added information about how to find the proper assembly file when trying to access script class methods.

WARNING: The following is a technical article. Don’t blame me if you find it boring!

I love Unity! The Unity iPhone engine is a fantastic piece of technology, allowing us to quickly develop games without having to worry about a lot of the underlying stuff. However, Unity is essentially an additional layer on top of the iPhone SDK, which means that while the iPhone SDK may advance with new features, the Unity engine is generally a step behind with adding these features in a manner that can be easily accessed through script.

Enter Objective-C: This is the language that iPhone apps are usually written in. Unity provides some support for calling native Objective-C code from Unity script, but only for Advanced licensees and only in one direction. This can be pretty limiting especially if you’re trying to use a lot of the fancy features in iPhone OS 3.0. Sure, you can pass around information using the PlayerPrefs trick. But this has the problem of not being instantaneous, and it forces the app to constantly poll for new commands, which probably isn’t a good idea performance-wise.

What follows is a method for immediately calling Objective-C code from Unity script (for both Basic and Advanced licenses) and also vice versa! That’s right, two-way communication between Objective-C and Unity script that’s instantaneous.

Merry Christmas!

Super Smoothie Available in the App Store!

We would like to announce that Super Smoothie, a game by our good friends at GoPlay Games, is now available in the App Store! This is a special game for us as we helped the gang at GoPlay in the development of this fun and fruity matching game.

Check out this gameplay video for Super Smoothie:

Super Smoothie is available NOW in the App Store here.

What We’re Working On – Week of November 9, 2009

Look! A WWWO post that’s actually on-time! Things must be looking up!

And indeed they are here at Tiny Tim Games. We’ve made a lot of progress in the last week, and I think it’s safe to say that we’ll be announcing a new game NEXT WEEK! It’s very exciting. Read on for more info.

What We’re Working On – Week of November 2, 2009

Last week was a big turning point in the development of both of our upcoming games. We settled on the main interface elements of “Game 2″, and we made some important decisions about “Game 3″ as well. We also set an internal milestone for getting these projects done. As of right now we’re planning to finish both games by the end of November! It’s an aggressive goal, but I believe we can make it.