Add reflection & debug inspector stuff to Score

This commit is contained in:
2025-08-14 13:10:47 -05:00
parent 40ee042b53
commit 0a7ffcfa0a
2 changed files with 3 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ impl Plugin for AsteroidPlugin {
.insert_resource(Lives(3)) .insert_resource(Lives(3))
.register_type::<Lives>() .register_type::<Lives>()
.insert_resource(Score(0)) .insert_resource(Score(0))
.register_type::<Score>()
.insert_resource(AsteroidSpawner::new()) .insert_resource(AsteroidSpawner::new())
.init_resource::<GameAssets>() .init_resource::<GameAssets>()
.add_systems(Startup, spawn_camera) .add_systems(Startup, spawn_camera)

View File

@@ -22,7 +22,8 @@ use crate::{
SHIP_THRUSTER_COLOR_INACTIVE, config::WINDOW_SIZE, SHIP_THRUSTER_COLOR_INACTIVE, config::WINDOW_SIZE,
}; };
#[derive(Resource, Debug, Deref, Clone, Copy)] #[derive(InspectorOptions, Reflect, Resource, Debug, Deref, Clone, Copy)]
#[reflect(Resource, InspectorOptions)]
pub struct Score(pub i32); pub struct Score(pub i32);
impl From<Score> for String { impl From<Score> for String {