Javascript in Unity, Including iPhone API's (Objective C?)

Hi guys,

I'm just getting started in unity, have been experimenting/following tutorials etc, and was just wondering something.

I'd like to get started in making iPhone games using Unity, but I have been learning to script in JavaScript. Apparently iPhone uses Objective C for its API's..?

I was wondering how it would work if I want to access iPhone specific features such as the new Gaming Network through unity script. Can these functions still be called?

Also, I've only got Unity Basic, and was intending on starting development on a game using it, and then purchase the Unity iPhone licence and port it to iPhone. Is there anything I should not include in my scripting or in the game in general, to make porting later easier?

Sorry if these seem like dumb/n00b questions! I'm learning all I can through searching out on my own, but some things like these I'm still unclear on since I can't test out myself at this point.

Thanks in advance! This community is fantastic. Been such a big help to me so far.

The classes for some iPhone APIs (touch/accelerometer/keyboard/etc.) are included in both Unity iPhone Basic and Advanced. Also you can use any iPhone API, not just those that Unity supports. But for those you have to program in XCode, and make some kind of bridge to get the results to the Unity side. In this case it's fastest and most convenient to use plugins with iPhone Advanced, but there are other ways (typically passing data using PlayerPrefs).

As far as Javascript programming goes, Unity iPhone doesn't allow dynamic typing. If you put "#pragma strict" at the top of your scripts in regular Unity, you get the same effect, so it's a good idea to always include this if you intend to use Unity iPhone. 99% of your code won't change, but there are a few areas where you have to explicitly type things, where normally you're probably using dynamic typing (usually with GetComponent).

you can only use iphone apis that unity supports. unity has some classes for iphone apis in it's iphone version but they are not available in the license that you currently have. try to write fast code and read th iphone tutorial in this page also take a look at this page. at the end unity gets your project and compiles it into ARM assembly code with Xcode. if you have a mac computer just download the 30 day trial of unity iphone and see how things work. reading the tutorial can help even if you don't have access to a mac computer. the most important things that you should think about them are your assets. they should be low resolution/polygon. don't use too many rigidbodies or too many particles.