Dissovle not fixed, but at least it doesn't crash!

main
Elijah C. Voigt 2 years ago
parent 1b70e0707e
commit e4e993ed64

@ -13,7 +13,7 @@ struct DissovleExtension {
percentage: f32,
}
@group(1) @binding(100)
@group(2) @binding(100)
var<uniform> dissolve: DissovleExtension;
fn random(st: vec2<f32>) -> f32 {

@ -36,7 +36,8 @@ impl Plugin for Display3dPlugin {
any_component_changed::<Piece>()
.or_else(any_component_changed::<Side>())
.or_else(any_component_changed::<BoardIndex>())
.or_else(any_component_removed::<Animating>()),
.or_else(any_component_removed::<Animating>())
.or_else(any_component_removed::<Captured>()),
),
),
set_board_model.run_if(any_component_added::<game::BoardComponent>()),
@ -45,11 +46,11 @@ impl Plugin for Display3dPlugin {
select
.run_if(in_state(GameState::Play))
.run_if(in_state(DisplayState::Display3d))
.run_if(on_event::<MouseButtonInput>()),
.run_if(just_pressed(MouseButton::Left)),
pick_up.run_if(any_component_added::<game::Selected>()),
put_down.run_if(any_component_removed::<game::Selected>()),
// setup_capture_piece.run_if(any_component_changed::<Handle<StandardMaterial>>()),
// capture_piece.run_if(any_with_component::<game::Captured>),
setup_capture_piece.run_if(any_component_added::<Handle<StandardMaterial>>().or_else(any_component_changed::<Handle<StandardMaterial>>())),
capture_piece.run_if(any_with_component::<game::Captured>),
skip_animation
.run_if(just_pressed(KeyCode::Enter).or_else(just_pressed(MouseButton::Left)))
.run_if(in_state(GameState::Play)),
@ -562,7 +563,7 @@ fn select(
events
.read()
// Only read button presses
.filter(|ev| ev.state == ButtonState::Pressed)
.filter(|ev| ev.state == ButtonState::Pressed && ev.button == MouseButton::Left)
.for_each(|_| {
// For each window (there should be only one)
windows.iter().for_each(|window| {
@ -1095,10 +1096,7 @@ fn setup_capture_piece(
// All entities with materials are candidates for this procedure
events: Query<
(Entity, &Handle<StandardMaterial>),
(
Added<Handle<StandardMaterial>>,
Changed<Handle<StandardMaterial>>,
),
>,
// Only process newly created pieces (we do not delete pieces at runtime)
query: Query<Entity, (With<Piece>, Added<Children>)>,
@ -1119,6 +1117,7 @@ fn setup_capture_piece(
.filter(|(child, _)| query.iter_many(parents.iter_ancestors(*child)).count() > 0)
// Handle this entity (mesh)
.for_each(|(child, std_handle)| {
info!("Setting up dissolve material for {:?}", child);
let dis_handle = match cache.get(std_handle) {
// We have not seen this material, so create a new dissolve material
None => {

Loading…
Cancel
Save