12 entt::meta_factory<animation_component::culling_mode>{}
13 .type(
"culling_mode"_hs)
18 .data<animation_component::culling_mode::always_animate>(
"always_animate"_hs)
23 .data<animation_component::culling_mode::renderer_based>(
"renderer_based"_hs)
30 entt::meta_factory<animation_component>{}
31 .type(
"animation_component"_hs)
47 .data<&animation_component::set_autoplay, &animation_component::get_autoplay>(
"auto_play"_hs)
51 entt::attribute{
"tooltip",
"Controls whether the animation should auto start."},
53 .data<&animation_component::set_culling_mode, &animation_component::get_culling_mode>(
"culling_mode"_hs)
57 entt::attribute{
"tooltip",
"Controls how the animation logic should be culled."},
59 .data<&animation_component::set_apply_root_motion, &animation_component::get_apply_root_motion>(
"apply_root_motion"_hs)
64 .data<&animation_component::set_speed, &animation_component::get_speed>(
"speed"_hs)
68 entt::attribute{
"tooltip",
"Controls the playback speed of the animation. 1.0 = normal speed, 2.0 = double speed, 0.5 = half speed."},
76 try_save(ar, ser20::make_nvp(
"animation", obj.get_animation()));
77 try_save(ar, ser20::make_nvp(
"auto_play", obj.get_autoplay()));
78 try_save(ar, ser20::make_nvp(
"culling_mode", obj.get_culling_mode()));
79 try_save(ar, ser20::make_nvp(
"apply_root_motion", obj.get_apply_root_motion()));
80 try_save(ar, ser20::make_nvp(
"speed", obj.get_speed()));
88 if(
try_load(ar, ser20::make_nvp(
"animation", animation)))
90 obj.set_animation(animation);
94 if(
try_load(ar, ser20::make_nvp(
"auto_play", auto_play)))
96 obj.set_autoplay(auto_play);
100 if(
try_load(ar, ser20::make_nvp(
"culling_mode", culling_mode)))
102 obj.set_culling_mode(culling_mode);
105 bool apply_root_motion{};
106 if(
try_load(ar, ser20::make_nvp(
"apply_root_motion", apply_root_motion)))
108 obj.set_apply_root_motion(apply_root_motion);
112 if(
try_load(ar, ser20::make_nvp(
"speed", speed)))
114 obj.set_speed(speed);
auto get_animation() const -> const asset_handle< animation_clip > &
void set_animation(const asset_handle< animation_clip > &animation)
attributes::value_type attribute
std::map< std::string, meta_any > attributes
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Represents a handle to an asset, providing access and management functions.