bevy_auto_update/resources.rs
1use bevy::prelude::*;
2
3use crate::prelude::Updater;
4
5#[derive(Resource, Debug, Clone, Copy, PartialEq)]
6pub enum UpdateStatus {
7 /// The updater is checking for an update
8 CheckingForUpdate,
9
10 /// There is no need to update
11 UpToDate,
12
13 /// The update is being downloaded
14 Downloading(f32),
15
16 /// The update is being installed
17 Installing(f32),
18
19 /// The update has finished installing
20 ///
21 /// Note: It is a very bad idea to run the game after this state.
22 /// Better to restart the game as assets are likely to be out of sync with the code.
23 FinishedInstalling,
24}
25
26#[derive(Resource)]
27pub(crate) struct AutoUpdateState<U: Updater> {
28 pub updater: U,
29}