assets/plugin.rs
1//! The [`AssetPlugin`] is responsible for loading the required information into Bevy.
2
3use crate::library::AssetLibrary;
4use bevy::app::App;
5use bevy::prelude::Plugin;
6
7/// Handles registering the required resources and functionality for the asset system.
8#[derive(Default)]
9pub struct AssetPlugin;
10
11impl Plugin for AssetPlugin {
12 fn build(&self, app: &mut App) {
13 let library = AssetLibrary::load_or_default(None).expect("Failed to load asset library");
14
15 app.insert_resource(library);
16 }
17}