- Home /
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 ?
Answer by DaveA · Oct 12, 2011 at 09:55 PM
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 program$$anonymous$$g section for the different touch screen functions for ipod / ipad ?
What you've posted does answer my much needed questions though ! thanks
Answer by jahroy · Oct 12, 2011 at 11:03 PM
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).
Your answer
![](https://koobas.hobune.stream/wayback/20220613005326im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Are random numbers consistent across devices? 1 Answer
How to get Audio output devices(Speaker) list in Unity? Like Microphone device list.. 1 Answer
Audio not working through headphones in editor 0 Answers
Official list of supported Android devices? 5 Answers
How to make a responsive game? 1 Answer