Can i get some help with: Worker ProgressChanged ?

I have this code and the loading bar is just from 0 to 100, how i can do to solve that, because i don’t want to be everytime 0% and when is done to be 100%

What i can do?

        private void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            string filePathDir = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Astro And Aliens Launcher\Data\" + dataFileName);
            int total = 1;

            for (int i = 0; i <= total; i++)
            {
                Thread.Sleep(100);
                int percents = (i * 100) / total;
                worker.ReportProgress(percents, i);

                WebClient wc = new WebClient();
                Stream zipReadingStream = wc.OpenRead(url);
                ZipArchive zip = new ZipArchive(zipReadingStream);
                zip.ExtractToDirectory(filePathDir, _progress);
            }
        }

        private void Worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            UpdateProgress.Visibility = Visibility.Visible;
            updatePercentText.Visibility = Visibility.Visible;

            UpdateProgress.Minimum = 0;

            UpdateProgress.Value = e.ProgressPercentage;
            updatePercentText.Content = String.Format("Downloading: {0}%", e.ProgressPercentage);
        }

Change the worker to unity sub routine and it’ll work, don’t try doing WinForms stuff in Unity, everything has it’s own way of doing stuff.

Is not in unity is in Visual Studio c#

In the wrong forums then buddy.

On that note aside though… The reason it is only going from 0 to 100 is because you are only loading/extracting one file, so its accurate . If you want the progress of the unzip of that specific file, go to google and search ‘c# unzip progress’. Plenty of solutions are available there.