mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-26 15:58:12 +00:00
adding AnimationsSystem.cpp
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Created by cbihan on 01/06/2021.
|
||||
//
|
||||
|
||||
#include "AnimationsSystem.hpp"
|
||||
#include "Component/Animation/AnimationsComponent.hpp"
|
||||
#include "Model/Model.hpp"
|
||||
#include "Component/Renderer/Drawable3DComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
{
|
||||
|
||||
AnimationsSystem::AnimationsSystem()
|
||||
: WAL::System({typeid(AnimationsComponent),
|
||||
typeid(Drawable3DComponent<RAY::Drawables::Drawables3D::Model>)})
|
||||
{
|
||||
}
|
||||
|
||||
void AnimationsSystem::onFixedUpdate(WAL::Entity &entity)
|
||||
{
|
||||
auto &model = entity.getComponent<Drawable3DComponent<RAY::Drawables::Drawables3D::Model>>();
|
||||
auto &anim = entity.getComponent<AnimationsComponent>();
|
||||
|
||||
model.member.setAnimation(anim.getCurrentModelAnim());
|
||||
anim.setAnimFrameCounter(anim.getAnimFrameCounter() + 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user