summaryrefslogtreecommitdiff
path: root/engine-macros/src
diff options
context:
space:
mode:
Diffstat (limited to 'engine-macros/src')
-rw-r--r--engine-macros/src/reflection/enum_impl.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/engine-macros/src/reflection/enum_impl.rs b/engine-macros/src/reflection/enum_impl.rs
index baf1732..f46b977 100644
--- a/engine-macros/src/reflection/enum_impl.rs
+++ b/engine-macros/src/reflection/enum_impl.rs
@@ -166,7 +166,17 @@ fn generate_impls(
get_default_value: || {
#get_default_value_fn
},
- cast_dyn_any: |ptr| ptr.cast::<Self>()
+ cast_dyn_any: |ptr| ptr.cast::<Self>(),
+ get_variant_reflection: |target| {
+ use std::any::Any;
+ use #engine_crate_path::reflection::EnumReflectionExt;
+
+ let target = target.downcast_ref::<Self>()?;
+
+ Some(<Self as EnumReflectionExt>::get_variant_reflection(
+ target
+ ))
+ }
}
)
};