load_type_registrations!() { /* proc-macro */ }
Expand description
Collects and loads type registrations when using auto_register_static
feature.
Correctly using this macro requires following:
- This macro must be called last during compilation. This can be achieved by putting your main function
in a separate crate or restructuring your project to be separated into
bin
andlib
, and putting this macro inbin
. Any automatic type registrations using#[derive(Reflect)]
within the same crate as this macro are not guaranteed to run. - Your project must be compiled with
auto_register_static
feature andBEVY_REFLECT_AUTO_REGISTER_STATIC=1
env variable. Enabling the feature generates registration functions while setting the variable enables export and caching of registration function names. - Must be called before creating
App
or usingTypeRegistry::register_derived_types
.
If you’re experiencing linking issues try running cargo clean
before rebuilding.