feat: implement contact listeners
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#ifndef DESTRUM_TRIGGERLOGGERCOMPONENT_H
|
||||
#define DESTRUM_TRIGGERLOGGERCOMPONENT_H
|
||||
#include "destrum/ObjectModel/Component.h"
|
||||
|
||||
class TriggerLoggerComponent: public Component {
|
||||
public:
|
||||
TriggerLoggerComponent(GameObject& parent);
|
||||
|
||||
std::string GetTypeName() const override { return "TriggerLoggerComponent"; }
|
||||
|
||||
void OnTriggerEnter(GameObject* other) override;
|
||||
void OnTriggerExit(GameObject* other) override;
|
||||
|
||||
nlohmann::json Serialize() const override;
|
||||
void Deserialize(const nlohmann::json&) override;
|
||||
|
||||
int triggerEnterCount{0};
|
||||
int triggerExitCount{0};
|
||||
std::string lastOtherName;
|
||||
};
|
||||
|
||||
#endif //DESTRUM_TRIGGERLOGGERCOMPONENT_H
|
||||
Reference in New Issue
Block a user