Class UnityLoadingOverlayProgressAnimator
Smooths the gameplay loading overlay's displayed progress toward the reported target so instantaneous progress jumps (e.g. a scene that loads in milliseconds) still render as a visible bar fill, and defers the overlay teardown until the bar has visibly reached 100%.
Namespace: Serenity.Ui.Infrastructure.Views
Assembly: Serenity.UnityUi.Infrastructure.dll
Syntax
public class UnityLoadingOverlayProgressAnimator : MonoBehaviour
Remarks
Runs on unscaled time because the game clock may be paused during scene loads (PauseDuringSceneLoad zeroes Time.timeScale). Attached to the overlay root by UnityGameplayLoadingOverlayView; destroying itself destroys the whole overlay.
Constructors
UnityLoadingOverlayProgressAnimator()
Declaration
public UnityLoadingOverlayProgressAnimator()
Methods
CompleteThenDestroy()
Forces the target to 100% and destroys the GameObject this animator is attached to once the displayed bar reaches it, capped by Serenity.Ui.Infrastructure.Views.UnityLoadingOverlayProgressAnimator.FINISH_SAFETY_TIMEOUT_SECONDS so the teardown can never hang.
Declaration
public void CompleteThenDestroy()
Initialize(Action<float>)
Sets the callback that renders the displayed progress (slider fill + percentage label).
Declaration
public void Initialize(Action<float> renderProgress)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<float> | renderProgress |
SetTarget(float)
Sets the normalized progress value the displayed bar animates toward.
Declaration
public void SetTarget(float normalized)
Parameters
| Type | Name | Description |
|---|---|---|
| float | normalized |