ScreenRegion.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
	public void Update() {
		localBounds = screenDimensionsHelper.LocalScreenBounds;
		if( camera ) {
			localBounds.center += cachedCameraTransform.localPosition;
			localBounds.size *= camera.orthographicSize;
		}

		localBounds.max -= ( camera ? camera.orthographicSize : 1f ) * new Vector3( marginRight, marginTop, 0f );
		localBounds.min += ( camera ? camera.orthographicSize : 1f ) * new Vector3( marginLeft, marginBottom, 0f );



		Vector3 center = localBounds.center;
		center.z = transform.position.z;
		localBounds.center = center;

		worldBounds = screenDimensionsHelper.WorldScreenBounds;
		if( camera ) {
			worldBounds.center += cachedCameraTransform.position;
			worldBounds.size *= camera.orthographicSize;
		}
		
		worldBounds.max -= ( camera ? camera.orthographicSize : 1f ) * transform.lossyScale.x * new Vector3( marginRight, marginTop, 0f );
		worldBounds.min += ( camera ? camera.orthographicSize : 1f ) * transform.lossyScale.x * new Vector3( marginLeft, marginBottom, 0f );

		center = worldBounds.center;
		center.z = transform.position.z;
		worldBounds.center = center;
		
	}