I just wanted to clarify… Can I use Unity to write a game for the iPhone (keeping in mind iPhone restrictions on poly size etc) and once I’m happy with it, buy Unity iPhone to publish?
Is it difficult to do so?
Do you recommend doing it all in Unity on the Mac and not Windows instead of designing it all on Windows then compiling the last on Mac+iPhone Unity?
Yes, you can prototype your game in regular Unity, and later port it to Unity iPhone. Doesn’t matter if you start on a Windows machine (but you must use a Mac for Unity iPhone).
If you’re using JavaScript, make sure you put the following at the top of all your scripts:
#pragma strict
Else your code may not work on the iPhone. And don’t program in Boo, as it’s not supported on the iPhone.
just for clarity… js code will work fine on the device without pragma strict. it’s a handy feature that alerts you that you’re duck typing. it doesn’t magically fix anything and if you strict type you don’t need it at all. it’s just a (good) warning flag.
yeah, 2.6 and 1.x projects are not compatible. i think oleg said the soon to be released 1.5.1 will be compatible with 2.6 projects. ask UT before committing yourself tho!
generally not all can be done on the desktop version anyway. you have terrains there which don’t exist on the iphone but don’t have occlusion culling which are basically a must for many 3d games. Not talking about the emulation and material differences. With JS instead of C# you can prepare yourself to rewrite code as the automagic does not exist on the iphone, so you will have to cast etc thing yourself … that makes the non unity iphone development usable up to a given point only.
Diceworks was originally created with the desktop Unity (Mac, this was before 2.5), and it took me about a day to get it running on an iPod 2g. It was JS and I had no clue about the #pragma strict back then, so the most work was converting the code. I had been a bit lucky, though, since there are things that don’t work on the iPhone. Then I used two to three months to get it running properly on the iPod.
Here’s a handy list
Don’t use OnMousenDown() etc, they’re not supported. Use Input.GetMouseDown() instead
Avoid OnGUI() (this is a bit disputed currently, I have to get back on this later)
Only one compressed sound at a time
Some physics features are missing
Memory limit is a lot lower than even on older PCs/Macs, and it’s a bit hard to grasp how low it can actually be.
All in all, I wouldn’t go much further than proof of concept/first playable without testing on the device. It can be done, and the desktop to iPhone conversion doesn’t take much time compared to normal porting process, but the odds are you’re going to end up with a lot better game if you can start testing with the device from early on.
your bullets are good points and once you know em, you won’t do that in your desktop build. but yeah, until you do know them, they are a pitfall.
@ OP et al… it you haven’t already, study up on the optimization threads in this iPhone forum and you’ll start knowing what not to do. that will make porting a lot easier. there are a bunch of topics covering it.
@arzi - the only disagreement is: you didn’t do your research before realizing you needed it. my first one… same!