feat(runtime): add M2 live play mode, assets, export and hot reload
- play/pause/stop with a tracked-transform snapshot and validation summary - asset browser with kind filters and image preview from project assets - BSN and imperative Rust export through bevy_forge_core codegen - .forge.ron watcher applying transform/name/visibility edits - 95 runtime tests; workspace 441 passed; M2 demo docs/screenshots
This commit is contained in:
@@ -12,14 +12,25 @@
|
||||
//! `FORGE_SCENE=""` disables scene loading. With no scene (or a load failure)
|
||||
//! the editor still starts with its placeholder camera and empty hierarchy.
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use bevy::{prelude::*, window::WindowResolution};
|
||||
use bevy_forge_runtime::EditorPlugin;
|
||||
|
||||
fn main() {
|
||||
// Let AssetServer resolve project-relative paths (`textures/coin.png`) from the
|
||||
// demo project's assets directory, not from the runtime crate's own assets.
|
||||
let project =
|
||||
std::env::var("FORGE_PROJECT").unwrap_or_else(|_| "examples/demo-project".to_string());
|
||||
let project = std::fs::canonicalize(&project).unwrap_or_else(|_| PathBuf::from(&project));
|
||||
if project.join("assets").is_dir() {
|
||||
std::env::set_var("BEVY_ASSET_ROOT", &project);
|
||||
}
|
||||
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||
primary_window: Some(Window {
|
||||
title: "Bevy Forge — M1 Core".into(),
|
||||
title: "Bevy Forge — M2 Live".into(),
|
||||
resolution: WindowResolution::new(1440, 900).with_scale_factor_override(1.0),
|
||||
..default()
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user