Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Start(string, string, Options, int)

This method starts a new progress indicator.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public static int Start(string name, string description = null, Progress.Options options = Options.None, int parentId = -1)

Parameters

name

The progress indicator's name. You can display the name as a title in the progress window. Use / (slash) as a separator to group child progress indicators together.

description

The progress indicator's initial description. You can change it using Report or SetDescription.

options

The progress indicator's initial progress options.

parentId

The unique ID of the parent progress indicator, if any. If the progress indicator has no parent, pass -1.

Returns

Type

Description

intThe newly created progress identifier. This identifier is used for all other APIs to update the progress status.

Examples

public IEnumerator Run_TwoTasks(){ var title1 = "Running task 1..."; var title2 = "Running task 2..."; int progressId1 = Progress.Start(title1); int progressId2 = Progress.Start(title2); Progress.ShowDetails(false); yield return null; for (int frame = 0; frame <= 10; ++frame) { Progress.Report(progressId1, Random.value); yield return WaitForSeconds(0.5f); Progress.Report(progressId2, Random.value); yield return WaitForSeconds(0.5f); } Progress.Remove(progressId1); Progress.Remove(progressId2);}