Parameter | Description |
---|---|
steps | Number of work steps to increment by. |
Increments the amount of completed work steps for this progress state.
Updates the progress by adding the specified number of completed work steps. This method is typically called by the implementation during operation execution to report incremental progress.
The progress percentage is calculated as: completedSteps / totalSteps.
Additional resources: SetTotalWorkSteps for setting the total expected work.
// Custom operation with manual progress reporting using var progress = new BakeProgressState(); progress.SetTotalWorkSteps(100);
for (int i = 0; i < 100; i++) { // Perform some work ProcessLightProbe(i);
// Report progress progress.IncrementCompletedWorkSteps(1);
// Log progress float currentProgress = progress.Progress(); Debug.Log($"Processing: {currentProgress * 100:F0}% complete");
// Check for cancellation if (progress.WasCancelled()) { Debug.Log("Operation cancelled by user"); break; } }