- Home /
Textures of different resolutions
Hello. I am developing game for iOS using Unity3D 4.3 Pro. I can't figure out, how to tell Unity to use ~iphone
, @2x~iphone
, ~ipad
or @2x~ipad
version of resources based on device type. And it would be great, if I could setup scene with only one version of resources.
I know, that 2D Toolkit can help me with my problem, but I don't want to use it only for this.
Answer by HarshadK · Jun 02, 2014 at 02:13 PM
Use SystemInfo.deviceModel to detect the device the game is running on and then load the specific resources based on it.
To load resources at runtime read: Loading Resources at Runtime
Thank you for your answer. But the problem is not every sprite is loaded in runtime. Some of them (for example, background) are added to scene via Sprite Renderer component.
You can add components at runtime through scripting. GameObject.AddComponent So you might want to load your assets that are added through spriterenderer at runtime itself. Quite a hectic job to do. Right?
@Harshad$$anonymous$$ Yes, thank you. But I think that is overhead do do such a things that seems to me so common. This is very bad, that there is no build-in solution for my problem.
Yes, it is overhead but we can't blame Unity for that since their 2D support is considerably new and it will take time to have such features integrated in the Unity itself. And there is reason that Unity has an Asset Store so that we users can put things up there for other users to be able to do things that are not available in Unity as a built-in feature. Hope sometimes in future there will be a feature integrated in Unity itself for what you are looking for. But remember, Rome was not built in a day. :-)
Thank you for conversation :) I'll try to find a way around it :)
Your answer
Follow this Question
Related Questions
Why a 109kb .png file teakes 8mb in unity? 1 Answer
How can I combine UV's with the Combine Children? 0 Answers
What is the best way to build a large game world, including texturing for iOS? 2 Answers
How to Port Game to iOS Device with same resolution in Engine ? 1 Answer
Question on iOS iPhone4 Resolution 2 Answers