Version: 2020.1
LanguageEnglish
  • C#

Progress

class in UnityEditor

/

Implemented in:UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The Progress utility class reports the progress of asynchronous tasks to Unity.

public IEnumerator Run_OneTask()
{
    // Create a new progress indicator
    int progressId = Progress.Start("Running one task", 0);

// Report the progress status at anytime for (int frame = 0; frame <= 1000; ++frame) { Progress.Report(progressId, "any progress update or null if it hasn't changed", frame / 1000.0f);

// Do something else yield return null; }

// The task is finished. Remove the associated progress indicator. Progress.Remove(progressId); }

Static Properties

globalProgressReturns the global average progression of all running tasks.
globalRemainingTimeReturns the maximum time remaining for all running progress indicators.
runningReturns true if there is at least one running progress indicator, false otherwise.

Static Methods

CancelCancels a runnning progress indicator, and invokes the cancel callback for the associated task.
ClearRemainingTimeResets the computation of a progress indicator's remaining time.
EnumerateItemsReturns an enumerator to loop over all progress indicators.
ExistsChecks whether a progress indicator with the specified ID exists.
FinishMarks the progress indicator as finished.
GetCountGets the number of available progress indicators.
GetCountPerStatusFor each available status, gets the number of progress indicators with that status.
GetDescriptionGets a progress indicator's description.
GetIdFinds a progress indicator's unique ID using its index in the set of all available progress indicators.
GetNameGets a progress indicator's name.
GetOptionsGets the options that you specified when you started the progress indicator.
GetParentIdGets the unique ID of the progress indicator's parent, if any.
GetProgressGets a progress indicator's progress.
GetProgressByIdGets information about a progress indicator.
GetRemainingTimeGets a progress indicator's remaining time, in seconds.
GetRunningProgressCountGets the number of active or running progress indicators.
GetStartDateTimeGets the timestamp of when the progress indicator started.
GetStatusGets the progress indicator's status.
GetTimeDisplayModeGet a progress indicator's time display mode.
GetUpdateDateTimeGets the time that the progress indicator last changed, or finished.
IsCancellableIndicates whether you can cancel the progress indicator's associated task.
RegisterCancelCallbackRegisters a callback that is called when the user cancels a running progress indicator's associated task.
RemoveFinishes and removes an active progress indicator.
ReportReports a running progress indicator's current status.
SetDescriptionSets the progress indicator's description. To clear the description pass null.
SetRemainingTimeSets the progress indicator's remaining time, in seconds.
SetTimeDisplayModeSet a progress indicator's time display mode.
ShowDetailsOpens the progress window for background tasks.
StartThis method starts a new progress indicator.
UnregisterCancelCallbackUnregisters a previously registered progress cancellation callback.

Events

addedAn event raised when a new progress indicator starts.
removedAn event raised when a progress indicator is removed.
updatedAn event raised when a progress indicator's state updates.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答