ImmutableOctet / glare

Glare: Open Source Game Engine written in Modern C++
MIT License
0 stars 0 forks source link

Implement convenient API for changing animations from C++ scripts #86

Open ImmutableOctet opened 1 month ago

ImmutableOctet commented 1 month ago

This would be something like:

set_animation("animation_name_here"_hs)

This could also be extended to support setting different animation layers:

set_animation("upper_body_animation_here"_hs, AnimationLayer::UpperBody);

In addition to a set_animation API, a really convenient option would be an assignment-based wrapper interface:

animation = "animation_name_here"_hs;
animation.upper_body = "upper_body_animation_here"_hs;

if (auto some_other_entity = co_await get_entity("some_other_entity_name"_hs))
{
    if (some_other_entity.animation == "some_animation"_hs)
    {
        // ...
    }
}