Blender_bevy_components_wor.../examples/basic/test_components.rs
Mark Moissette 528e13a250
feat(): Blueprints, crates, enhanced Blender tooling & more (#5)
* feat(bevy_gltf_components):
	* create crate 
	* added SystemSet (GltfComponentsSet) to run process_loaded_scenes (where components are injected)
	in a specific systemset & allow ordering other systems relative to it

* feat(bevy_gltf_blueprints): 
	* created crate
	* made the blueprint library path configurable
	* added BluePrintBundle helper
	* added SystemSet (GltfBlueprintsSet) for better system ordering
	* integrated into advanced demo

* feat(tools-blender-auto-export): 
	* renamed blender tool to gltf_auto_export
   	* rewritten auto_export
	* added blueprint / prefab support
		* creates scene with empties with BlueprintName components in the scene
		* export of the main scene now exports this scene instead of real main scene
		* changes collection stand in names in original scene & sets them back after export
			to have correctly named collection instance exports
		* also added an additional 'SpawnHere' component to not conflate BlueprintNames & spawning requests
   		* toggling & blueprint library output parameters added
   		* added correct handling/ restoring of saved selection when using blueprints

* feat(examples): 
	* added advanced example
	* general example renamed to "basic", and cleaned up

* feat(various): a lot of experiments with saving & loading etc

* chore(assets): updated blend & generated assets

* fix(examples-advanced): disabling hot reloading as it messes up scenes in experiments with save & loading

* docs(): 
	* added & fleshing out docs for the various crates & main README
	* added process doc image & tweaks to README
 	* added missing licence info where relevant
 	* fixed broken links
 	* clarified some aspects
 	* added updated screenshots where relevant
 	* added tweaks & improvements etc
2023-09-28 14:10:45 +02:00

87 lines
2.0 KiB
Rust

use bevy::prelude::*;
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct UnitTest;
#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)]
#[reflect(Component)]
struct TuppleTestF32(f32);
#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)]
#[reflect(Component)]
struct TuppleTestU64(u64);
#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)]
#[reflect(Component)]
pub struct TuppleTestStr(String);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct TuppleTest2(f32, u64, String);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct TuppleTestBool(bool);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct TuppleVec2(Vec2);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct TuppleVec3(Vec3);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct TuppleVec(Vec<String>);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct TuppleTestColor(Color);
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
struct BasicTest{
a: f32,
b: u64,
c: String
}
#[derive(Component, Reflect, Default, Debug, )]
#[reflect(Component)]
pub enum EnumTest{
Metal,
Wood,
Rock,
Cloth,
Squishy,
#[default]
None
}
pub struct ComponentsTestPlugin;
impl Plugin for ComponentsTestPlugin {
fn build(&self, app: &mut App) {
app
.register_type::<BasicTest>()
.register_type::<UnitTest>()
.register_type::<TuppleTestF32>()
.register_type::<TuppleTestU64>()
.register_type::<TuppleTestStr>()
.register_type::<TuppleTestBool>()
.register_type::<TuppleTest2>()
.register_type::<TuppleVec2>()
.register_type::<TuppleVec3>()
.register_type::<EnumTest>()
.register_type::<TuppleTestColor>()
.register_type::<TuppleVec>()
.register_type::<Vec<String>>()
;
}
}