Class WebContentPreloader
Downloads every Addressables bundle into the browser before the player can log in, so nothing is fetched during play. Only web builds do this; see IsRequired.
public static class WebContentPreloader
- Inheritance
-
WebContentPreloader
- Inherited Members
Remarks
Addressables' own DownloadDependenciesAsync is no use here: caching is compiled out of
it on WebGL, so it always reports everything as missing and would fetch the full set through
the engine on every visit. The list of bundles comes from the catalog; the download itself
happens in WebContentPreloader.jslib, which also explains where the files go.
Properties
IsRequired
True when this build must have the full content set before the player can log in.
public static bool IsRequired { get; }
Property Value
Methods
Cancel()
Stops a running download. Bundles already finished stay cached, so the next Run(Action<DownloadStats>, Action, Action<string>) continues from them.
public static void Cancel()
Run(Action<DownloadStats>, Action, Action<string>)
Brings the browser's copy of the content up to date. Exactly one of
onComplete and onError is invoked, unless the
download is cancelled, which invokes neither.
public static IEnumerator Run(Action<DownloadStats> onProgress, Action onComplete, Action<string> onError)
Parameters
onProgressAction<DownloadStats>onCompleteActiononErrorAction<string>