2024-02-27 16:07:14 +00:00
|
|
|
#include "WblRobotCitizen.h"
|
|
|
|
#include "MovementAIComponent.h"
|
|
|
|
#include "RenderComponent.h"
|
|
|
|
|
|
|
|
void WblRobotCitizen::OnStartup(Entity* self) {
|
|
|
|
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
|
|
|
if (!movementAIComponent) return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void WblRobotCitizen::OnUse(Entity* self, Entity* user) {
|
2024-03-27 02:06:22 +00:00
|
|
|
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
|
|
|
if (movementAIComponent) movementAIComponent->Pause();
|
2024-02-27 16:07:14 +00:00
|
|
|
auto face = NiQuaternion::LookAt(self->GetPosition(), user->GetPosition());
|
|
|
|
self->SetRotation(face);
|
2024-03-27 02:06:22 +00:00
|
|
|
auto timer = RenderComponent::PlayAnimation(self, "wave", 0.4f);
|
2024-02-27 16:07:14 +00:00
|
|
|
self->AddTimer("animation time", timer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
|
|
|
if (!movementAIComponent) return;
|
2024-03-27 02:06:22 +00:00
|
|
|
movementAIComponent->Resume();
|
2024-02-27 16:07:14 +00:00
|
|
|
}
|