Releasing on different devices

I’m about to release my game and was wondering about programming controls for different devices. Right now I want to release my game on ipad / iphone but am unsure of what code I would need to change. I need to program touch pad controls which is not in my current version. Would I need to change my controls for ipad, iphone, xbox, android, ect. Or can I just add an || statement for each control so no matter what system it’s released on the controls will function or will it give errors. Also can I code the controls in unity for ipad / iphone or do I need to port it using the iphone sdk and change the controls there ?

2 Answers

2

You shouldn’t need the iphone sdk aside from the black-box that is the ‘build and run’ process where Unity launches xcode and does it all for you.

You could pepper your code with things like

#if UNITY_ANDROID || UNITY_IPHONE
  .. do it this way..
#endif

#if UNITY_WEBPLAYER
 ..  do it that way ...
#endif

or 

if (Application.platform == RuntimePlatform.IPhonePlayer)
 .. do that too ..

see http://unity3d.com/support/documentation/Manual/Platform%20Dependent%20Compilation.html

Is there a programming section for the different touch screen functions for ipod / ipad ? What you've posted does answer my much needed questions though ! thanks

–

The hacky way we solved for faster rotations was to cover our object (mesh) with many box colliders. This way the box colliders will make sure the object does not go through. You just need to place as much as small box colliders to match/cover your mesh collider. Again not a great solution but works well for us. Also make sure the colliding object also has a collider (i.e. Box or Sphere collider).

–

I would start here:

http://unity3d.com/support/documentation/Manual/Input.html

Then I would go here:

http://unity3d.com/support/documentation/ScriptReference/Input.html

There are situations where normal (mouse) input can be interpretted properly by a touchpad device, but most of the time you'll have to handle the touch input separately yourself.

iPhone, iPad, and iPod touch input should all be the same with few exceptions (an iPod touch might not be able to handle 10 touches on the screen at the same time).