IncrementCompletedWorkSteps(ulong)
Increments the amount of completed work steps for this progress state.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Method
- Namespace: UnityEngine.LightTransport
- Assembly: UnityEngine.CoreModule
public void IncrementCompletedWorkSteps(ulong steps)
Parameters
Number of work steps to increment by.
Remarks
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: BakeProgressState.SetTotalWorkSteps for setting the total expected work.
Examples
// Custom operation with manual progress reportingusing 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; }}