Skip to main content

Class LoadingProgressUI

A UI progress bar component that displays the current scene asset loading progress. It updates its value when it receives a corresponding message.

[RequireComponent(typeof(Slider))]
public class LoadingProgressUI : MonoBehaviour, IHandle<LoadingProgressMessage>

Inheritance​

Implements​

IHandle<LoadingProgressMessage>

Remarks​

This component listening to event aggregator. When a LoadingProgressMessage is published, the LoadingProgressMessage) method is invoked, and the progress bar will update.

Methods​

Handle(LoadingProgressMessage)​

Processes the received message and applies its payload to this subscriber's state.

Update the current value of the progress bar value.

public void Handle(LoadingProgressMessage message)

Parameters​

NameTypeDescription
messageLoadingProgressMessageThe message containing the current progress value (0 to 1).

Remarks​

Called by the event aggregator when a LoadingProgressMessage is received.

SetProgress(float)​

Updates the progress bar's current progress value.

public void SetProgress(float progress)

Parameters​

NameTypeDescription
progressfloatThe current progress (0 to 1).