Add asset plugins to headless app

This commit is contained in:
Danny McGee
2024-03-20 19:59:46 -04:00
parent e991635402
commit 76def340de
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ use bevy::{
app::{AppExit, ScheduleRunnerPlugin}, app::{AppExit, ScheduleRunnerPlugin},
prelude::*, prelude::*,
}; };
use bevy_web_asset::WebAssetPlugin;
use space_editor::prelude::{EditorEvent, EditorPrefabPath}; use space_editor::prelude::{EditorEvent, EditorPrefabPath};
use wgpu::Extent3d; use wgpu::Extent3d;
@@ -12,7 +13,7 @@ use crate::{
scene::SceneState, scene::SceneState,
screenshot::{ScreenCapture, ScreenShotPlugin}, screenshot::{ScreenCapture, ScreenShotPlugin},
BvhPlugin, CommonPlugins, LoadLibraryObjectEvent, LoadSceneEvent, MainCamera, BvhPlugin, CommonPlugins, LoadLibraryObjectEvent, LoadSceneEvent, MainCamera,
MixamoImportEvent, MixamoPlugin, SkyboxId, StudioMode, WorldGridPlugin, MixamoImportEvent, MixamoPlugin, RemoteAssetPlugin, SkyboxId, StudioMode, WorldGridPlugin,
}; };
#[derive(Debug, Resource, Clone)] #[derive(Debug, Resource, Clone)]
@@ -42,6 +43,8 @@ pub fn start_headless(
app.add_plugins(( app.add_plugins((
ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1.0 / fps as f64)), ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1.0 / fps as f64)),
WebAssetPlugin,
RemoteAssetPlugin,
DefaultPlugins.set(WindowPlugin { DefaultPlugins.set(WindowPlugin {
primary_window: None, primary_window: None,
exit_condition: bevy::window::ExitCondition::DontExit, exit_condition: bevy::window::ExitCondition::DontExit,
+1
View File
@@ -46,6 +46,7 @@ const mimeTypes = {
".otf": "font/otf", ".otf": "font/otf",
".png": "image/png", ".png": "image/png",
".rar": "application/x-rar-compressed", ".rar": "application/x-rar-compressed",
".ron": "text/ron",
".svg": "image/svg+xml", ".svg": "image/svg+xml",
".tiff": "image/tiff", ".tiff": "image/tiff",
".ttf": "font/ttf", ".ttf": "font/ttf",