iphone screen size

anyone know how to make a game’s screen size fit right for iphone 5 and 6? i wan’t it so that when i’m working on unity, it’s in the same size as iphone and can detect if it’s on iphone’s screen.

now i’m using the free aspect ratio. I set the dimensions to 1136 x 640 and i’m working on windows

As to iPhone screen sizes it’s all here.

Add a custom screen size to the editor, click the “free aspect” widget and use the + sign at the bottom of the drop down menu.

As to detecting the size of the target device, have you tried? Last time I built a Unity project on an iOS device I seem to recall having done nothing special to get it to work at target device resolution.

Bear in mind that you will need an OS-X computer (aka, a Mac) to create an iPhone/iPad build.

I set the screen size to one aspect ratio and update as so it work perfect for me for any screeen size

void Start ()
	{

		if( this.GetComponent<Camera>().aspect > 0.7f  && this.GetComponent<Camera>().aspect < .8f)
		{
			//print ( this.GetComponent<Camera>().aspect );
			GetComponent<Camera>().orthographicSize = 6.46f;
		}
		else if(this.GetComponent<Camera>().aspect > 0.52f  && this.GetComponent<Camera>().aspect < .58f)
		{
			//print ( this.GetComponent<Camera>().aspect );
			GetComponent<Camera>().orthographicSize = 8.38f;
		}

		else if(this.GetComponent<Camera>().aspect > 0.6f  && this.GetComponent<Camera>().aspect < .67f)
		{
			//print ( this.GetComponent<Camera>().aspect );
			GetComponent<Camera>().orthographicSize = 7.18f;
		}

		else if(this.GetComponent<Camera>().aspect > 0.55f  && this.GetComponent<Camera>().aspect < .59f)
		{
			//print ( this.GetComponent<Camera>().aspect );
			GetComponent<Camera>().orthographicSize = 8.21f;
		}
	}