diff --git a/src/dynamic_action.rs b/src/dynamic_action.rs index 29b1049f..d35fa8dd 100644 --- a/src/dynamic_action.rs +++ b/src/dynamic_action.rs @@ -41,7 +41,7 @@ use std::any::TypeId; use std::hash::Hash; -use bevy::reflect::TypePath; +use bevy::reflect::Reflect; use bevy::{ prelude::{App, Resource}, utils::HashMap, @@ -60,7 +60,7 @@ static DYN_ACTION_MAP: OnceCell> = OnceCell::new(); static REGISTRY_CREATED: OnceCell<()> = OnceCell::new(); /// The runtime representation of actions declared via marker types -#[derive(Copy, Clone, PartialEq, Eq, Hash, TypePath)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Reflect)] pub struct DynAction(usize); /// Coordinates the registration of dynamic action types diff --git a/src/lib.rs b/src/lib.rs index 80aa9c6c..2338e048 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ use crate::action_state::ActionState; use crate::input_map::InputMap; use bevy::ecs::prelude::*; -use bevy::reflect::TypePath; +use bevy::reflect::Reflect; use std::hash::Hash; use std::marker::PhantomData; @@ -81,7 +81,7 @@ pub mod prelude { /// Ultimate, /// } /// ``` -pub trait Actionlike: Eq + Hash + Send + Sync + Clone + Hash + TypePath + 'static { +pub trait Actionlike: Eq + Hash + Send + Sync + Clone + Hash + Reflect + 'static { /// The number of variants of this action type fn n_variants() -> usize; diff --git a/src/plugin.rs b/src/plugin.rs index ec105ba1..be9f22c3 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -11,6 +11,7 @@ use bevy::app::{App, Plugin}; use bevy::ecs::prelude::*; use bevy::input::InputSystem; use bevy::prelude::{PostUpdate, PreUpdate}; +use bevy::reflect::TypePath; #[cfg(feature = "ui")] use bevy::ui::UiSystem; @@ -79,7 +80,7 @@ enum Machine { Client, } -impl Plugin for InputManagerPlugin { +impl Plugin for InputManagerPlugin { fn build(&self, app: &mut App) { use crate::systems::*;