adding the possibility to pause/resume an animation

This commit is contained in:
Clément Le Bihan
2021-06-02 16:11:14 +02:00
parent f245fe727b
commit b3eae9ebdf
3 changed files with 24 additions and 3 deletions
@@ -8,10 +8,11 @@
namespace BBM
{
AnimationsComponent::AnimationsComponent(WAL::Entity &entity, RAY::ModelAnimations modelAnimation, int animIndex)
AnimationsComponent::AnimationsComponent(WAL::Entity &entity, RAY::ModelAnimations modelAnimation, int animIndex, bool play)
: WAL::Component(entity),
_modelAnimation(std::move(modelAnimation)),
_currentAnimIndex(animIndex)
_currentAnimIndex(animIndex),
_animDisabled(play)
{
this->_modelAnimation[this->_currentAnimIndex].setFrameCounter(0);
}
@@ -57,4 +58,14 @@ namespace BBM
{
this->_modelAnimation[this->_currentAnimIndex].incrementFrameCounter();
}
void AnimationsComponent::setAnimDisabled(bool disable)
{
this->_animDisabled = disable;
}
bool AnimationsComponent::isAnimDisabled() const
{
return this->_animDisabled;
}
}