Compare commits
No commits in common. "1031e0602488102e9bf027f32f79996ab05a40d4" and "47972f0f6c7baa52fd6f9b37d70e734abc4a4c8d" have entirely different histories.
1031e06024
...
47972f0f6c
2 changed files with 10 additions and 40 deletions
|
|
@ -3,14 +3,6 @@ use bevy::prelude::*;
|
|||
|
||||
pub mod hand;
|
||||
|
||||
pub struct CardsPlugin;
|
||||
|
||||
impl Plugin for CardsPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_observer(on_create_card);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Card;
|
||||
|
||||
|
|
@ -25,34 +17,13 @@ pub fn on_create_card(
|
|||
atlas_layout: Res<LofparaAtlasLayout>,
|
||||
atlas_sprite: Res<LofparaAtlasImage>,
|
||||
) {
|
||||
if let Some(parent) = event.parent {
|
||||
commands.spawn((
|
||||
Card,
|
||||
Transform::from_xyz(0., 0., 0.),
|
||||
Sprite {
|
||||
image: atlas_sprite.get(),
|
||||
image_mode: SpriteImageMode::Auto,
|
||||
texture_atlas: Some(TextureAtlas {
|
||||
layout: atlas_layout.get(),
|
||||
index: 0,
|
||||
}),
|
||||
..default()
|
||||
},
|
||||
ChildOf(parent),
|
||||
));
|
||||
} else {
|
||||
commands.spawn((
|
||||
Card,
|
||||
Transform::from_xyz(0., 0., 0.),
|
||||
Sprite {
|
||||
image: atlas_sprite.get(),
|
||||
image_mode: SpriteImageMode::Auto,
|
||||
texture_atlas: Some(TextureAtlas {
|
||||
layout: atlas_layout.get(),
|
||||
index: 0,
|
||||
}),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
}
|
||||
commands.spawn((
|
||||
Card,
|
||||
Transform::from_xyz(0., 0., 0.),
|
||||
/*Sprite {
|
||||
image: atlas_sprite.get(),
|
||||
image_mode: SpriteImageMode::Auto,
|
||||
texture_atlas: Some(TextureAtlas { layout: , index: () })
|
||||
},*/
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use crate::cards::CardsPlugin;
|
||||
use crate::lofpara_atlas::LofparaAtlasPlugin;
|
||||
|
||||
mod cards;
|
||||
mod lofpara_atlas;
|
||||
|
||||
fn main() {
|
||||
App::new().add_plugins((DefaultPlugins, LofparaAtlasPlugin, CardsPlugin));
|
||||
App::new().add_plugins((DefaultPlugins, LofparaAtlasPlugin));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue