chore(examples): minor tweaks
This commit is contained in:
parent
f27c8a078c
commit
1a7ea5bd4a
|
@ -203,6 +203,19 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"typeInfo": "List"
|
"typeInfo": "List"
|
||||||
},
|
},
|
||||||
|
"alloc::vec::Vec<blenvy::blueprints::materials::MaterialInfo>": {
|
||||||
|
"isComponent": false,
|
||||||
|
"isResource": false,
|
||||||
|
"items": {
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/blenvy::blueprints::materials::MaterialInfo"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"long_name": "alloc::vec::Vec<blenvy::blueprints::materials::MaterialInfo>",
|
||||||
|
"short_name": "Vec<MaterialInfo>",
|
||||||
|
"type": "array",
|
||||||
|
"typeInfo": "List"
|
||||||
|
},
|
||||||
"alloc::vec::Vec<f32>": {
|
"alloc::vec::Vec<f32>": {
|
||||||
"isComponent": false,
|
"isComponent": false,
|
||||||
"isResource": false,
|
"isResource": false,
|
||||||
|
@ -1410,6 +1423,44 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"typeInfo": "Enum"
|
"typeInfo": "Enum"
|
||||||
},
|
},
|
||||||
|
"bevy_asset::handle::Handle<blenvy::blueprints::assets::BlueprintPreloadAssets>": {
|
||||||
|
"isComponent": true,
|
||||||
|
"isResource": false,
|
||||||
|
"long_name": "bevy_asset::handle::Handle<blenvy::blueprints::assets::BlueprintPreloadAssets>",
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"items": false,
|
||||||
|
"long_name": "Strong",
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/std::sync::Arc<bevy_asset::handle::StrongHandle>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"short_name": "Strong",
|
||||||
|
"type": "array",
|
||||||
|
"typeInfo": "Tuple"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"items": false,
|
||||||
|
"long_name": "Weak",
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/bevy_asset::id::AssetId<blenvy::blueprints::assets::BlueprintPreloadAssets>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"short_name": "Weak",
|
||||||
|
"type": "array",
|
||||||
|
"typeInfo": "Tuple"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"short_name": "Handle<BlueprintPreloadAssets>",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Enum"
|
||||||
|
},
|
||||||
"bevy_asset::id::AssetId<()>": {
|
"bevy_asset::id::AssetId<()>": {
|
||||||
"isComponent": false,
|
"isComponent": false,
|
||||||
"isResource": false,
|
"isResource": false,
|
||||||
|
@ -2422,6 +2473,52 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"typeInfo": "Enum"
|
"typeInfo": "Enum"
|
||||||
},
|
},
|
||||||
|
"bevy_asset::id::AssetId<blenvy::blueprints::assets::BlueprintPreloadAssets>": {
|
||||||
|
"isComponent": false,
|
||||||
|
"isResource": false,
|
||||||
|
"long_name": "bevy_asset::id::AssetId<blenvy::blueprints::assets::BlueprintPreloadAssets>",
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"additionalProperties": false,
|
||||||
|
"long_name": "Index",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"long_name": "index",
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/bevy_asset::assets::AssetIndex"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index"
|
||||||
|
],
|
||||||
|
"short_name": "Index",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Struct"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"additionalProperties": false,
|
||||||
|
"long_name": "Uuid",
|
||||||
|
"properties": {
|
||||||
|
"uuid": {
|
||||||
|
"long_name": "uuid",
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/uuid::Uuid"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"uuid"
|
||||||
|
],
|
||||||
|
"short_name": "Uuid",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Struct"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"short_name": "AssetId<BlueprintPreloadAssets>",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Enum"
|
||||||
|
},
|
||||||
"bevy_asset::path::AssetPath": {
|
"bevy_asset::path::AssetPath": {
|
||||||
"isComponent": false,
|
"isComponent": false,
|
||||||
"isResource": false,
|
"isResource": false,
|
||||||
|
@ -12353,7 +12450,7 @@
|
||||||
},
|
},
|
||||||
"blenvy::blueprints::materials::MaterialInfo": {
|
"blenvy::blueprints::materials::MaterialInfo": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"isComponent": true,
|
"isComponent": false,
|
||||||
"isResource": false,
|
"isResource": false,
|
||||||
"long_name": "blenvy::blueprints::materials::MaterialInfo",
|
"long_name": "blenvy::blueprints::materials::MaterialInfo",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -12376,6 +12473,22 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"typeInfo": "Struct"
|
"typeInfo": "Struct"
|
||||||
},
|
},
|
||||||
|
"blenvy::blueprints::materials::MaterialInfos": {
|
||||||
|
"isComponent": true,
|
||||||
|
"isResource": false,
|
||||||
|
"items": false,
|
||||||
|
"long_name": "blenvy::blueprints::materials::MaterialInfos",
|
||||||
|
"prefixItems": [
|
||||||
|
{
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/alloc::vec::Vec<blenvy::blueprints::materials::MaterialInfo>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"short_name": "MaterialInfos",
|
||||||
|
"type": "array",
|
||||||
|
"typeInfo": "TupleStruct"
|
||||||
|
},
|
||||||
"blenvy::blueprints::spawn_from_blueprints::BlueprintInfo": {
|
"blenvy::blueprints::spawn_from_blueprints::BlueprintInfo": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"isComponent": true,
|
"isComponent": true,
|
||||||
|
@ -12401,6 +12514,17 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"typeInfo": "Struct"
|
"typeInfo": "Struct"
|
||||||
},
|
},
|
||||||
|
"blenvy::blueprints::spawn_from_blueprints::BlueprintInstanceDisabled": {
|
||||||
|
"additionalProperties": false,
|
||||||
|
"isComponent": true,
|
||||||
|
"isResource": false,
|
||||||
|
"long_name": "blenvy::blueprints::spawn_from_blueprints::BlueprintInstanceDisabled",
|
||||||
|
"properties": {},
|
||||||
|
"required": [],
|
||||||
|
"short_name": "BlueprintInstanceDisabled",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Struct"
|
||||||
|
},
|
||||||
"blenvy::blueprints::spawn_from_blueprints::HideUntilReady": {
|
"blenvy::blueprints::spawn_from_blueprints::HideUntilReady": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"isComponent": true,
|
"isComponent": true,
|
||||||
|
@ -12541,6 +12665,28 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"typeInfo": "Enum"
|
"typeInfo": "Enum"
|
||||||
},
|
},
|
||||||
|
"blenvy::save_load::Dynamic": {
|
||||||
|
"additionalProperties": false,
|
||||||
|
"isComponent": true,
|
||||||
|
"isResource": false,
|
||||||
|
"long_name": "blenvy::save_load::Dynamic",
|
||||||
|
"properties": {},
|
||||||
|
"required": [],
|
||||||
|
"short_name": "Dynamic",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Struct"
|
||||||
|
},
|
||||||
|
"blenvy::save_load::StaticEntitiesRoot": {
|
||||||
|
"additionalProperties": false,
|
||||||
|
"isComponent": true,
|
||||||
|
"isResource": false,
|
||||||
|
"long_name": "blenvy::save_load::StaticEntitiesRoot",
|
||||||
|
"properties": {},
|
||||||
|
"required": [],
|
||||||
|
"short_name": "StaticEntitiesRoot",
|
||||||
|
"type": "object",
|
||||||
|
"typeInfo": "Struct"
|
||||||
|
},
|
||||||
"blenvy_animation_example::Fox": {
|
"blenvy_animation_example::Fox": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"isComponent": true,
|
"isComponent": true,
|
||||||
|
|
|
@ -2,11 +2,10 @@ use std::time::Duration;
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use blenvy::{
|
use blenvy::{
|
||||||
AddToGameWorld, BlenvyPlugin, BluePrintBundle, BlueprintAnimationPlayerLink,
|
BlenvyPlugin, BlueprintAnimationPlayerLink,
|
||||||
BlueprintAnimations, BlueprintInfo, DynamicBlueprintInstance, GameWorldTag, HideUntilReady,
|
BlueprintAnimations, BlueprintInfo, GameWorldTag, HideUntilReady,
|
||||||
SpawnBlueprint,
|
SpawnBlueprint,
|
||||||
};
|
};
|
||||||
use rand::Rng;
|
|
||||||
|
|
||||||
mod component_examples;
|
mod component_examples;
|
||||||
use component_examples::*;
|
use component_examples::*;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use blenvy::{
|
use blenvy::{
|
||||||
AddToGameWorld, BlenvyPlugin, BluePrintBundle, BlueprintInfo, DynamicBlueprintInstance,
|
AddToGameWorld, BlenvyPlugin, BluePrintBundle, BlueprintInfo, Dynamic, GameWorldTag, HideUntilReady, SpawnBlueprint
|
||||||
GameWorldTag, HideUntilReady, SpawnBlueprint,
|
|
||||||
};
|
};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
|
@ -36,12 +35,8 @@ fn setup_game(mut commands: Commands) {
|
||||||
pub fn spawn_blueprint_instance(
|
pub fn spawn_blueprint_instance(
|
||||||
keycode: Res<ButtonInput<KeyCode>>,
|
keycode: Res<ButtonInput<KeyCode>>,
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
|
|
||||||
mut game_world: Query<(Entity, &Children), With<GameWorldTag>>,
|
|
||||||
) {
|
) {
|
||||||
if keycode.just_pressed(KeyCode::KeyS) {
|
if keycode.just_pressed(KeyCode::KeyS) {
|
||||||
let world = game_world.single_mut();
|
|
||||||
let world = world.1[0];
|
|
||||||
|
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
let range = 5.5;
|
let range = 5.5;
|
||||||
|
@ -50,7 +45,7 @@ pub fn spawn_blueprint_instance(
|
||||||
|
|
||||||
let name_index: u64 = rng.gen();
|
let name_index: u64 = rng.gen();
|
||||||
|
|
||||||
let new_entity = commands
|
let __new_entity = commands
|
||||||
.spawn((
|
.spawn((
|
||||||
BluePrintBundle {
|
BluePrintBundle {
|
||||||
blueprint: BlueprintInfo {
|
blueprint: BlueprintInfo {
|
||||||
|
@ -59,7 +54,7 @@ pub fn spawn_blueprint_instance(
|
||||||
}, // FIXME
|
}, // FIXME
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
DynamicBlueprintInstance,
|
Dynamic,
|
||||||
bevy::prelude::Name::from(format!("test{}", name_index)),
|
bevy::prelude::Name::from(format!("test{}", name_index)),
|
||||||
HideUntilReady,
|
HideUntilReady,
|
||||||
AddToGameWorld,
|
AddToGameWorld,
|
||||||
|
|
|
@ -8,7 +8,6 @@ pub mod level_transitions;
|
||||||
pub use level_transitions::*;
|
pub use level_transitions::*;
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_gltf_worlflow_examples_common_rapier::{AppState, GameState};
|
|
||||||
|
|
||||||
pub struct GamePlugin;
|
pub struct GamePlugin;
|
||||||
impl Plugin for GamePlugin {
|
impl Plugin for GamePlugin {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::any::TypeId;
|
use std::any::TypeId;
|
||||||
|
|
||||||
use bevy::{prelude::*, utils::hashbrown::HashSet};
|
use bevy::{prelude::*, utils::hashbrown::HashSet};
|
||||||
use blenvy::{AddToGameWorld, BlenvyPlugin, BlueprintInfo, BlueprintWorld, Dynamic, DynamicBlueprintInstance, GameWorldTag, HideUntilReady, LoadingRequest, SavingRequest, SpawnBlueprint};
|
use blenvy::{AddToGameWorld, BlenvyPlugin, BlueprintInfo, BlueprintWorld, Dynamic, GameWorldTag, HideUntilReady, LoadingRequest, SavingRequest, SpawnBlueprint};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
// mod game;
|
// mod game;
|
||||||
|
@ -77,7 +77,7 @@ fn spawn_blueprint_instance(
|
||||||
.spawn((
|
.spawn((
|
||||||
BlueprintInfo::from_path("blueprints/test.glb"),
|
BlueprintInfo::from_path("blueprints/test.glb"),
|
||||||
SpawnBlueprint,
|
SpawnBlueprint,
|
||||||
DynamicBlueprintInstance,
|
Dynamic,
|
||||||
bevy::prelude::Name::from(format!("test{}", name_index)),
|
bevy::prelude::Name::from(format!("test{}", name_index)),
|
||||||
HideUntilReady,
|
HideUntilReady,
|
||||||
AddToGameWorld,
|
AddToGameWorld,
|
||||||
|
|
Loading…
Reference in New Issue