убери отсюда многопоточность 
public class PdfFilesUI : MonoBehaviour
    {
        private const string PathName = "/StreamingAssets/PDF/Training";
        private const string FileExtension = "*.pdf";
        private const string PathConverter = "/../Converter/pdf2img.exe";
        private const string PathImage = " pageRight.png ";
        private const string PathImageFull = "/../pageRight.png";

        [SerializeField]
        private Transform _contentButton;
        [SerializeField]
        private Transform _contentImage;
        [SerializeField]
        private PDFbutton _buttonPrefab;
        [SerializeField]
        private Image _imagePrefab;
        [SerializeField]
        private ScrollRect _scrollRect;

        private string pdfConverterPath;
        private string folderPath; // Внесите переменную сюда
        private string dataApplicationPath;

        private Dictionary<Button, Image[]> buttonToImagesMapping = new Dictionary<Button, Image[]>();
        private List<Image[]> allImageGroups = new List<Image[]>();

        public async void Initialize()
        {
            dataApplicationPath = Application.dataPath;
            pdfConverterPath = Application.dataPath + PathConverter;
            folderPath = Application.dataPath + PathName; // Ее значение инициализируется здесь
            await FindPdfFilesAsync();
        }

        private async Task FindPdfFilesAsync()
        {
            //var folderPath = Application.dataPath + PathName;
            var pdfFiles = Directory.GetFiles(folderPath, FileExtension, SearchOption.AllDirectories);

            List<Task> tasks = new List<Task>();

            foreach (string file in pdfFiles)
            {
                tasks.Add(ProcessPdfFileAsync(file));
            }

            await Task.WhenAll(tasks);
        }

        private async Task ProcessPdfFileAsync(string file)
        {
            var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file);
            var button = Instantiate(_buttonPrefab, _contentButton);
            button.Initialized(fileNameWithoutExtension, file);
            var pageCount = 0;

            using (PdfReader reader = new PdfReader(file))
            {
                pageCount = reader.NumberOfPages;
            }

            var imageGroup = new Image[pageCount];
            var tasks = new List<Task<string>>();

            for (int pageNumber = 0; pageNumber < pageCount; pageNumber++)
            {
                var localPageNumber = pageNumber; // Локальная переменная для каждой итерации цикла
                var localFilePath = file + PathImage + localPageNumber.ToString(); // Локальная переменная для пути к файлу

                // Вызываем обработку изображения синхронно
                CallExternalProcess(pdfConverterPath, localFilePath);

                // Обрабатываем полученный путь к изображению
                var imagePath = dataApplicationPath + PathImageFull;
                imageGroup[localPageNumber] = ApplyTextureToUI(imagePath);
            }

            UnityMainThreadDispatcher.Instance().Enqueue(() =>
            {
                button.Button.onClick.AddListener(() => AllImagesOn(imageGroup));
                buttonToImagesMapping[button.Button] = imageGroup;
            });
        }


            public void AllImagesOff()
        {
            if (allImageGroups == null) return; // Добавить эту проверку

            foreach (Image[] images in allImageGroups)
            {
                foreach (var image in images)
                {
                    if (image != null && image.gameObject != null) // Добавить эту проверку
                    {
                        image.gameObject.SetActive(false);
                    }
                }
            }
        }

        public void AllImagesOn(Image[] imageGroup)
        {
            AllImagesOff();

            if (imageGroup == null) return; // Добавить эту проверку

            foreach (Image image in imageGroup)
            {
                if (image != null && image.gameObject != null) // Добавить эту проверку
                {
                    image.gameObject.SetActive(true);
                }
            }
            _scrollRect.verticalNormalizedPosition = 1;
        }

        public Texture2D LoadPNG(string filePath)
        {
            Texture2D texture = null;

            if (File.Exists(filePath))
            {
                var fileData = File.ReadAllBytes(filePath);
                texture = new Texture2D(2, 2);
                texture.LoadImage(fileData);
            }

            return texture;
        }

        public Image ApplyTextureToUI(string filePath)
        {
            var texture = LoadPNG(filePath);

            if (texture != null)
            {
                var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), 100.0f);

                var image = Instantiate(_imagePrefab, _contentImage);
                image.sprite = sprite;
                return image;
            }
            return null;
        }

        public void CallExternalProcess(string processPath, string arguments)
        {
            var myProcess = new Process();
            myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            myProcess.StartInfo.CreateNoWindow = true;
            myProcess.StartInfo.UseShellExecute = false;
            myProcess.StartInfo.FileName = processPath;

            myProcess.StartInfo.Arguments = arguments;
            myProcess.EnableRaisingEvents = true;
            try
            {
                myProcess.Start();
            }
            catch (InvalidOperationException ex)
            {
                UnityEngine.Debug.LogError(ex);
            }
            myProcess.WaitForExit();
            var ExitCode = myProcess.ExitCode;
        }
    }