Hi,
How do i know what i get out of entity? How do i know it has a get::<Name>
or get::<GltfExtras> ?
I'm trying to read Scale variable to set it's coliders size
commands.spawn(HookedSceneBundle {
scene: SceneBundle {
scene: level_one,
transform: Transform::from_xyz(1.0, 0.6, 0.0),
..Default::default()
},
hook: SceneHook::new(|entity, cmds| {
match entity.get::<GltfExtras>().map(|t| t) {
Some(val) => {
let json: serde_json::Value =
serde_json::from_str(&val.value).expect("JSON was not well-formatted");
match entity.get::<Name>().map(|t| t) {
Some(name) => {
println!("{:?}", gltf_node);
}
None => todo!(),
};
println!("{:?}", entity_scale);
cmds.insert(RigidBody::Dynamic)
.insert(Collider::cuboid(0.5, 0.5, 0.5));
println!("{:?}", json);
return ();
}
None => cmds,
};
}),
});
