Hello Aren!
We are try to switch between sd and hd Atlas to use in Retina and non-Retina resolutions. For example, our sd atlas have an icon with 130x100 pixels and our hd atlas have this icon too, but in this case with 260x200. We are using pixel size too: SD(1f) HD(0.5f). And our switching script is like this code:
public class AtlasPair {
public string name;
public UIAtlas reference;
}
...
public AtlasPair[] atlasses;
UIAtlas atlasReference;
UIAtlas fontAtlasReference;
string qualitySuffix;
Dictionary<string, UIAtlas> instances;
void Start () {
instances
= new Dictionary
<string, UIAtlas
> (); qualitySuffix = (Screen.height <= 768) ? "low" : "high";
for (int i = 0; i < atlasses.Length; i++) {
if (atlasses[i].name.Length == 0) {
Debug.LogWarning ("[GUI] No name for element " + i, gameObject);
continue;
}
if (atlasses[i].reference == null) {
Debug.LogWarning ("[GUI] No atlas for element " + i, gameObject);
continue;
}
UIAtlas reference = Instantiate (atlasses[i].reference) as UIAtlas;
atlasses
[i
].reference.replacement = Resources
.Load ("Atlasses/" + atlasses
[i
].name + "_" + qualitySuffix,
typeof(UIAtlas
)) as UIAtlas
;
instances.Add (atlasses[i].name, reference);
}
Our problem is: When We launch the app in sd all is correct, however when We launch this in HD, all the widgets keep their low size (I.E. 130x100 for my icon).