Progress updated in place
Updated
One notification with an id is updated in place: a progress bar fills over three seconds, turns indeterminate while unpacking, then reports done.
Watch the notification in the bottom-right corner fill, unpack and finish. Reload the example to see it again.
Progress updated in place
#pragma lifecycle(startup)
// Scene: nothing to prepare. Simulates a three-second task with a progress bar.async function startup() { NotificationService.show( NotificationType.Info, { title: 'Downloading', text: '0%' }, { id: 'download', anchor: 'bottom-right', duration: Infinity, progress: 0 }, );
await Tween.value(0, 1, (done) => { NotificationService.update('download', { text: `${Math.round(done * 100)}%` }, { progress: done }); }, { duration: 3 });
NotificationService.update('download', { text: 'Unpacking…' }, { progress: 'indeterminate' }); await new Promise((resolve) => delay(resolve, 1500));
NotificationService.update('download', { title: 'Done', text: 'Ready to play.' }, { progress: undefined }); delay(() => NotificationService.dismiss(NotificationType.Info), 2000);}How it works
Section titled “How it works”The script is explained step by step in Progress updated in place.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
ProgressNotification.xrproj