-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
144 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use beet_examples::prelude::*; | ||
use beet_flow::prelude::*; | ||
use bevy::prelude::*; | ||
|
||
|
||
fn main() { | ||
App::new() | ||
.add_plugins((crate_test_beet_example_plugin, plugin_ml)) | ||
.insert_resource(BeetDebugConfig::default()) | ||
.add_systems( | ||
Startup, | ||
( | ||
setup, | ||
beetmash::core::scenes::lighting_3d, | ||
beetmash::core::scenes::ground_3d, | ||
beetmash::core::scenes::ui_terminal_input, | ||
beet_examples::emote_agent::scenes::spawn_barbarian, | ||
), | ||
) | ||
// .add_systems(Update,disable_barbarian) | ||
.run(); | ||
} | ||
|
||
|
||
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) { | ||
commands.spawn(( | ||
Camera3d::default(), | ||
Transform::from_xyz(0., 1.6, 5.), // .looking_at(Vec3::ZERO, Vec3::Y), | ||
)); | ||
|
||
commands.insert_resource(EmojiMap::new(&asset_server)); | ||
} |
24 changes: 24 additions & 0 deletions
24
crates/beet_examples/src/emote_agent/apply_render_layers.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use bevy::prelude::*; | ||
use bevy::render::view::RenderLayers; | ||
use bevy::scene::SceneInstanceReady; | ||
|
||
|
||
/// Currently [`RenderLayers`] are not applied to children of a scene. | ||
/// This [`SceneInstanceReady`] observer applies the [`RenderLayers`] | ||
/// of a [`SceneRoot`] to all children with a [`Transform`]. | ||
pub fn apply_render_layers_to_children( | ||
trigger: Trigger<SceneInstanceReady>, | ||
mut commands: Commands, | ||
children: Query<&Children>, | ||
transforms: Query<&Transform>, | ||
query: Populated<(Entity, &RenderLayers)>, | ||
) { | ||
let Ok((parent, render_layers)) = query.get(trigger.entity()) else { | ||
return; | ||
}; | ||
children.iter_descendants(parent).for_each(|entity| { | ||
if transforms.contains(entity) { | ||
commands.entity(entity).insert(render_layers.clone()); | ||
} | ||
}); | ||
} |
16 changes: 16 additions & 0 deletions
16
crates/beet_examples/src/emote_agent/emote_agent_plugin.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use crate::prelude::*; | ||
use bevy::prelude::*; | ||
|
||
|
||
|
||
pub fn emote_agent_plugin(app: &mut App) { | ||
app.add_observer(apply_render_layers_to_children) | ||
.add_systems( | ||
Update, | ||
( | ||
ik_spawner.never_param_warn(), | ||
update_emoji_swapper.never_param_warn(), | ||
), | ||
) | ||
.register_type::<IkSpawner>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::prelude::*; | ||
|
||
|
||
pub type InsertOnRun<T> = InsertOnTrigger<OnRun, T>; | ||
pub type InsertOnRunResult<T> = InsertOnTrigger<OnRunResult, T>; | ||
|
||
pub type RemoveOnRun<T> = RemoveOnTrigger<OnRun, T>; | ||
pub type RemoveOnRunResult<T> = RemoveOnTrigger<OnRunResult, T>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.