I found this script on the internet, that should make the game fit all size phones. But it does not work! Maybe i missed something and thats why im asking here.
var originalWidth = 640.0; // define here the original resolution
var originalHeight = 400.0; // you used to create the GUI contents
function Start() {
// calculate scales
var scaleX : float = Screen.width / originalWidth;
var scaleY : float = Screen.height / originalHeight;
// find all texts and change the scale
var texts : TextMesh[] = FindObjectsOfType(TextMesh) as TextMesh[];
for (var text : TextMesh in texts) {
text.transform.localScale = new Vector3(text.transform.localScale.x * scaleX, text.transform.localScale.y * scaleY, text.transform.localScale.z);
}
// find all gui textures and change the scale
var textures : GuiTexture[] = FindObjectsOfType(GuiTexture) as GuiTexture[];
for (var texture : GuiTexture in textures) {
texture.transform.localScale = new Vector3(texture.transform.localScale.x * scaleX, texture.transform.localScale.y * scaleY, texture.transform.localScale.z);
}
}