public async UniTask <byte[]> CaptureFulllevel(bool isTransparent, RectInt?rect = null)
    {
        if (isTransparent)
        {
            Controller.obj.levelController.controllerTilemap.backgroundTint.gameObject.SetActive(false);
        }
        //Camera[] cams = Camera.allCameras.OrderBy(c => c.depth).ToArray();
        int width            = LevelEditorData.MaxWidth;
        int height           = LevelEditorData.MaxHeight;
        int cellSize         = LevelEditorData.Level.CellSize;
        int screenshotWidth  = Mathf.CeilToInt(width / (float)cellSize);
        int screenshotHeight = Mathf.CeilToInt(height / (float)cellSize);
        var cellSizeInUnits  = cellSize / (float)LevelEditorData.Level.PixelsPerUnit;
        Dictionary <Camera, CameraSettings> camSettings = new Dictionary <Camera, CameraSettings>();
        EditorCam ec = Controller.obj?.levelController?.editor?.cam;

        ec.enabled = false;
        List <Camera> cameras = new List <Camera>();

        // Add main camera
        {
            Camera cam = Camera.main;
            camSettings[cam] = CameraSettings.Current(cam);

            cam.transform.position = new Vector3((LevelEditorData.MaxWidth) * cellSizeInUnits / 2f, -(LevelEditorData.MaxHeight) * cellSizeInUnits / 2f, cam.transform.position.z);
            cam.orthographicSize   = (LevelEditorData.MaxHeight * cellSizeInUnits / 2f);
            cam.rect = new Rect(0, 0, 1, 1);
            cameras.Add(cam);
        }
        if (LevelEditorData.Level?.IsometricData != null)
        {
            // Add isometric camera
            Camera cam = ec.camera3D;

            camSettings[cam] = CameraSettings.Current(cam);

            // Update 3D camera
            float      scl   = 1f;
            Quaternion rot3D = LevelEditorData.Level.IsometricData.ViewAngle;
            cam.transform.rotation = rot3D;
            Vector3 v = rot3D * Vector3.back;
            float   w = LevelEditorData.Level.IsometricData.TilesWidth * cellSizeInUnits;
            float   h = (LevelEditorData.Level.IsometricData.TilesHeight) * cellSizeInUnits;
            float   colYDisplacement = LevelEditorData.Level.IsometricData.CalculateYDisplacement();
            float   colXDisplacement = LevelEditorData.Level.IsometricData.CalculateXDisplacement();

            var pos = new Vector3((LevelEditorData.MaxWidth) * cellSizeInUnits / 2f, -(LevelEditorData.MaxHeight) * cellSizeInUnits / 2f, -10f);

            cam.transform.position = v * 300 + rot3D * ((pos -
                                                         new Vector3((w - colXDisplacement) / 2f, -(h - colYDisplacement) / 2f, 0f)) / scl); // Move back 300 units
            cam.orthographicSize = Camera.main.orthographicSize / scl;
            cam.rect             = new Rect(0, 0, 1, 1);
            cam.orthographic     = true;
            cam.gameObject.SetActive(true);
            cameras.Add(cam);

            await UniTask.WaitForEndOfFrame();

            // Update all object positions & rotations according to this new camera pos
            var objects = Controller.obj.levelController.Objects;
            foreach (var obj in objects)
            {
                obj.UpdatePosition3D();
            }
        }
        await UniTask.WaitForEndOfFrame();

        byte[] screenshotBytes = null;
        var    lScreenshot     = zzTransparencyCapture.CaptureScreenshot(width * cellSize, height * cellSize, isTransparent, camera: cameras.ToArray());

        foreach (var cam in cameras)
        {
            camSettings[cam].Apply(cam);
        }
        ec.enabled = true;
        try
        {
            if (rect != null)
            {
                lScreenshot = lScreenshot.Crop(rect.Value, true);
            }

            screenshotBytes = lScreenshot.EncodeToPNG();
        } finally {
            Object.DestroyImmediate(lScreenshot);
        }
        if (isTransparent)
        {
            Controller.obj.levelController.controllerTilemap.backgroundTint.gameObject.SetActive(true);
        }
        Debug.Log("Screenshot saved.");
        return(screenshotBytes);
    }