Struct AddressableProgress
An immutable snapshot of the progress state for an in-flight Addressables operation.
Used as the report value type for IProgress<AddressableProgress> callbacks
supplied to loading, downloading, and batch operations in
ScyllaAddressables.
Inherited Members
Namespace: Scylla.Core.Util.Addressables
Assembly: ScyllaCore.dll
Syntax
public readonly struct AddressableProgress
Remarks
AddressableProgress is a readonly struct, so each report is a
separate value-type snapshot. Callers that need to display live progress should
store the most recent instance received from the IProgress<T>
callback.
Three specialized constructors cover the common reporting scenarios:
- Simple percentage - use when only the normalized 0-1 value is needed.
- Download progress - populates BytesDownloaded and TotalBytes and auto-generates a KB display string in StatusMessage.
- Batch progress - populates CurrentAsset, AssetsProcessed, and TotalAssets and auto-generates a count display string in StatusMessage.
The full-parameter constructor allows combining all fields simultaneously when both download and batch information are available.
Constructors
AddressableProgress(float)
Initializes a new AddressableProgress snapshot with only a normalized percentage value. All byte, asset count, and message fields are set to their zero/null defaults. Use this constructor when only coarse percentage feedback is available.
Declaration
public AddressableProgress(float percentComplete)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentComplete | The normalized progress of the operation in the range |
AddressableProgress(float, long, long?)
Initializes a new AddressableProgress snapshot with download byte counters. StatusMessage is auto-generated as a KB-formatted string. Use this constructor when reporting progress for remote asset bundle or catalog downloads.
Declaration
public AddressableProgress(float percentComplete, long bytesDownloaded, long? totalBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentComplete | The normalized progress of the operation in the range |
| long | bytesDownloaded | The number of bytes transferred so far. Must be non-negative; sourced from
|
| long? | totalBytes | The total bytes to download, or |
AddressableProgress(float, long, long?, string, int, int?, string)
Initializes a new AddressableProgress snapshot with all available fields populated explicitly. Use this constructor when a single progress report must convey both download byte counters and batch asset counters simultaneously, or when a fully custom StatusMessage is required.
Declaration
public AddressableProgress(float percentComplete, long bytesDownloaded, long? totalBytes, string currentAsset, int assetsProcessed, int? totalAssets, string statusMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentComplete | The normalized progress of the operation in the range |
| long | bytesDownloaded | The number of bytes transferred so far. Pass |
| long? | totalBytes | The total bytes to download, or |
| string | currentAsset | The Addressables address of the asset currently being processed, or |
| int | assetsProcessed | The number of assets that have completed loading so far. Pass |
| int? | totalAssets | The total number of assets in the batch, or |
| string | statusMessage | A caller-supplied human-readable status string. Unlike the other constructors,
no message is auto-generated; pass |
AddressableProgress(float, string, int, int?)
Initializes a new AddressableProgress snapshot with batch asset processing counters. StatusMessage is auto-generated as a count-formatted string. Use this constructor when reporting progress through a list of individually loaded assets.
Declaration
public AddressableProgress(float percentComplete, string currentAsset, int assetsProcessed, int? totalAssets)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentComplete | The normalized progress of the operation in the range |
| string | currentAsset | The Addressables address of the asset currently being processed. May be
|
| int | assetsProcessed | The number of assets that have completed loading so far. Must be non-negative. |
| int? | totalAssets | The total number of assets in the batch, or |
Properties
AssetsProcessed
Gets the number of individual assets that have completed loading in a batch
operation. This field is 0 for single-asset loads and for download-only
progress snapshots.
Declaration
public int AssetsProcessed { get; }
Property Value
| Type | Description |
|---|---|
| int |
BytesDownloaded
Gets the number of bytes transferred so far during a download operation. This
field is only meaningful when the operation involves remote content; it is
0 for local asset loads and for batch operations constructed with the
batch-progress constructor.
Declaration
public long BytesDownloaded { get; }
Property Value
| Type | Description |
|---|---|
| long |
CurrentAsset
Gets the Addressables address (asset key) of the asset currently being loaded or
processed in a batch operation, or null when this is a simple percentage
or download-only progress snapshot.
Declaration
public string CurrentAsset { get; }
Property Value
| Type | Description |
|---|---|
| string |
PercentComplete
Gets the normalized progress of the operation in the range [0.0, 1.0],
where 0.0 means not started and 1.0 means fully complete. This
value is sourced directly from the Unity AsyncOperationHandle.PercentComplete
property and may not advance linearly for bundle downloads.
Declaration
public float PercentComplete { get; }
Property Value
| Type | Description |
|---|---|
| float |
StatusMessage
Gets a pre-formatted, human-readable status string suitable for display in a loading screen or debug UI. The format depends on which constructor was used:
-
Simple percentage constructor:
null(no message generated). -
Download constructor with known total:
"Downloading: X KB / Y KB". -
Download constructor without known total:
"Downloading: X KB". -
Batch constructor with known total:
"Loading: X / Y". -
Batch constructor without known total:
"Loading: X assets". -
Full constructor: the caller-supplied
statusMessagestring, which may benull.
Declaration
public string StatusMessage { get; }
Property Value
| Type | Description |
|---|---|
| string |
TotalAssets
Gets the total number of assets in a batch operation if known, or null
when the total cannot be determined. Check TotalAssets.HasValue
before rendering a "X of Y assets" progress string.
Declaration
public int? TotalAssets { get; }
Property Value
| Type | Description |
|---|---|
| int? |
TotalBytes
Gets the total number of bytes to be downloaded, if the Addressables system was
able to determine the size before the download began. Returns null when
the total size is unknown (e.g., for streaming or when no catalog download size
is available). Check TotalBytes.HasValue before displaying
a "X of Y KB" style progress indicator.
Declaration
public long? TotalBytes { get; }
Property Value
| Type | Description |
|---|---|
| long? |