Version: 2021.2
public static int Start (string name, string description, Progress.Options options, int parentId);

参数

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.
parentId The unique ID of the parent progress indicator, if any. If the progress indicator has no parent, pass -1.
options The progress indicator's initial progress options.

返回

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

描述

This method starts a new progress indicator.

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); }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961