mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-26 07:49:33 +00:00
adding the possibility to pause/resume an animation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user