Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by batman · Jan 20, 2012 at 04:38 AM · c#androidios

Things to do to port game made for iOS in Unity to Android?

Hi! I have just made my first game for iOS and submitted it to app store. I was thinking of porting my game to Android also. I would like to know things one need to do/remember to port game made for iOS in Unity to Android. How to handle different screen resolutions and pixel densities, optimizations required, etc. Any other suggestions and important things you think I should know?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by OpenSky · Mar 24, 2014 at 08:19 PM

-How to handle different screen resolutions and pixel densities ? -Simple, just transform the pixels in percents of the screen like this :
From :

if(GUI.Button(new Rect(Screen.width - 50, 2, 60, 50), optionsTexture, gui)) { Application.LoadLevel(2); }

To

 if(GUI.Button(new Rect(Screen.width - 0.081f * xPos, 2, 0.078f * xPos, 0.078f * yPos), optionsTexture, gui)) {
         Application.LoadLevel(2);
     }

where xPos = Screen.width; and yPos = Screen.height. P.S: 1f xPos means 100% of the screen width, and 0.1f xPos means 10% of the screen width.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Adamcbrz · Mar 25, 2014 at 01:13 PM

Well this is a hard question to answer. Essentially if you didn't do anything ios specific then the port is pretty strait forward. There are some issues with texture compression but I will try and explain.

Texture Compression:

If you are using compressed textures then you have either have to rule out alot of devices or have a way to switch between the 3 different texture compressions. Well that is not entirely true. Let me elaborate. There are three different chip sets which support three different texture compressions ATC, DXT, and PVRTC. Now android has a fallback compression level that all chip sets are required to support, ETC. So you just might ask yourself why don't I just use ETC compression. And the reason is that the quality/file size is not as good. So that leaves you with three different texture compressions to handle all three devices. (I usually handle this by swapping between the textures/materials at runtime utilizing the SystemInfo.graphicsDeviceName to determine the chipset)

Screen Resolutions:

  1. You can do the simple ways and add black bars for all device that don't fit the iOS standard resolutions. This is was something I saw more in the earlier days of android.

  2. You can adjust the layout based on screen resolution and have a different layout for each screen resolution. This is probably a bad idea because it doesn't scale well and there are new devices all the time.

  3. You can scale your interface to fit the screen. Where you place everything in a GameObject and scale the that gameobject depending on screen size. This approach is really easy to implement but can give pore results because it can cause stretching.

  4. You can scale each item and position based on a percentage of screensize. This is what @OpenSky suggested. Honestly this is probably the best solution on most fronts.

There are other things to help optimize but they are dependent on problems. That is all I can think of right now.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Tiled GPU warning: RenderTexture color surface errors? 0 Answers

C++ windows DLL and Android? 1 Answer

How to know which code depends on System.dll in mono C#? 1 Answer

System.Diagnostics.Process on iOs and Android 1 Answer

How to know if my speakers are mute? c# android/ios 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges