mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-22 20:00:53 +00:00
d1b5d2627d
- replaced the various crates with a single one - replaced the Blender add-ons with a single one - this is an alpha release ! - for features etc see the various docs
76 lines
1.9 KiB
Rust
76 lines
1.9 KiB
Rust
use bevy::prelude::*;
|
|
|
|
#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)]
|
|
#[reflect(Component)]
|
|
struct TupleTestF32(f32);
|
|
|
|
#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)]
|
|
#[reflect(Component)]
|
|
struct TupleTestU64(u64);
|
|
|
|
#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)]
|
|
#[reflect(Component)]
|
|
pub struct TupleTestStr(String);
|
|
|
|
#[derive(Component, Reflect, Default, Debug)]
|
|
#[reflect(Component)]
|
|
struct TupleTest2(f32, u64, String);
|
|
|
|
#[derive(Component, Reflect, Default, Debug)]
|
|
#[reflect(Component)]
|
|
struct TupleTestBool(bool);
|
|
|
|
#[derive(Component, Reflect, Default, Debug)]
|
|
#[reflect(Component)]
|
|
struct TupleVec2(Vec2);
|
|
|
|
#[derive(Component, Reflect, Default, Debug)]
|
|
#[reflect(Component)]
|
|
struct TupleVec3(Vec3);
|
|
|
|
#[derive(Component, Reflect, Default, Debug)]
|
|
#[reflect(Component)]
|
|
struct TupleVec(Vec<String>);
|
|
|
|
#[derive(Component, Reflect, Default, Debug)]
|
|
#[reflect(Component)]
|
|
struct TupleTestColor(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 ComponentsExamplesPlugin;
|
|
impl Plugin for ComponentsExamplesPlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.register_type::<BasicTest>()
|
|
.register_type::<TupleTestF32>()
|
|
.register_type::<TupleTestU64>()
|
|
.register_type::<TupleTestStr>()
|
|
.register_type::<TupleTestBool>()
|
|
.register_type::<TupleTest2>()
|
|
.register_type::<TupleVec2>()
|
|
.register_type::<TupleVec3>()
|
|
.register_type::<EnumTest>()
|
|
.register_type::<TupleTestColor>()
|
|
.register_type::<TupleVec>()
|
|
.register_type::<Vec<String>>();
|
|
}
|
|
}
|