internal void SetupCameraGameObject(GameObject camGameObject) { Debug.Assert(_initialized); Debug.Assert(LayerMask.LayerToName(camMaskLayer) != null || LayerMask.LayerToName(camMaskLayer) != ""); LayerMask camMask = 1 << camMaskLayer; Camera myCamera = camGameObject.AddComponent <Camera>(); myCamera.enabled = false; myCamera.orthographic = true; myCamera.orthographicSize = height / 2f; myCamera.aspect = ((float)width) / height; myCamera.rect = new Rect(0, 0, 1, 1); myCamera.clearFlags = CameraClearFlags.Color; myCamera.cullingMask = camMask; Transform camTransform = myCamera.GetComponent <Transform>(); camTransform.localPosition = new Vector3(width / 2.0f, height / 2f, 0); camTransform.localRotation = Quaternion.Euler(0, 0, 0); MBVersion.DoSpecialRenderPipeline_TexturePackerFastSetup(camGameObject); _camSetup = true; }