BBGamelib.UIWindow.setResolutionHeight C# (CSharp) Method

setResolutionHeight() public method

public setResolutionHeight ( float hInPixels ) : void
hInPixels float
return void
		public void setResolutionHeight(float hInPixels){
			float wInPixels = hInPixels * Camera.main.aspect;
			float h = hInPixels / PIXEL_PER_UNIT;
			float w = wInPixels / PIXEL_PER_UNIT;
			Rect boundsInPixels = new Rect (-wInPixels / 2, -hInPixels / 2, wInPixels, hInPixels);
			_bounds = boundsInPixels;

			Camera.main.orthographicSize = h / 2;
			Vector3 cameraPos = Camera.main.transform.position;
			cameraPos.x = w / 2;
			cameraPos.y = h / 2;
			Camera.main.transform.position = cameraPos;
		}