/// <summary> /// Report a child progress task and return a token with its id and the same cancellation token. /// </summary> /// <param name="name">Name of the task</param> /// <param name="description">Description of the task</param> /// <param name="options">Options for the progress, will be combined with <see cref="defaultOptions"/></param> public TaskToken StartChild(string name, string description = null, Progress.Options options = default) { var parent = parentId > 0 ? parentId : taskId; return(new TaskToken() { taskId = Progress.Start(name, description, options | defaultOptions, parent), parentId = parent, cancellation = cancellation, context = context, }); }
public GUIDConversionTask(string taskName, string taskDescription, EditorApplication.CallbackFunction updateAction, Func <bool> cancelAction, bool isIndefinite = false) { m_TaskName = taskName; m_TaskDescription = taskDescription; m_UpdateAction = updateAction; m_CancelAction = cancelAction; if (isIndefinite) { m_ProgressOptions = Progress.Options.Indefinite; } }
public ProgressScope ( string name, string description = null, Progress.Options options = Progress.Options.None, int parentId = -1 ) { Id = Progress.Start ( name: name, description: description, options: options, parentId: parentId ); }
/// <summary> /// Create a new task token without a parent. /// </summary> /// <param name="name">Name of the task</param> /// <param name="cancellation">Token to cancel the task</param> /// <param name="description">Description of the task</param> /// <param name="options">Options for the progress, will be combined with <see cref="defaultOptions"/></param> public static TaskToken Start(string name, CancellationToken cancellation = default, string description = null, Progress.Options options = default) { return(new TaskToken() { taskId = Progress.Start(name, description, options | defaultOptions), cancellation = cancellation }); }