pub mod ui;
pub mod input;
pub mod plugins;
use crate::client::colors;
use crate::prelude::*;
use crate::ship_editor::input::input_plugin;
use crate::ship_editor::ui::ui_plugin;
pub struct ShipEditorPlugin;
impl Plugin for ShipEditorPlugin {
fn build(&self, app: &mut App) {
app
.add_systems(Startup, setup)
.add_plugins(input_plugin)
.add_plugins(ui_plugin);
}
}
fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
commands.insert_resource(ClearColor(colors::BASE));
commands.spawn((
Camera2d::default(),
Transform::from_xyz(0.0, 0.0, 0.0),
));
let rectangle = meshes.add(Rectangle::new(50.0, 50.0));
commands.spawn((
Mesh2d(rectangle),
MeshMaterial2d(materials.add(Color::linear_rgb(0.0, 0.0, 0.0))),
Transform::from_xyz(0.0, 0.0, 0.0)
));
}