feat: add interactable component and test button
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#ifndef LIGHTKEEPER_INTERACTABLEBUTTON_H
|
||||
#define LIGHTKEEPER_INTERACTABLEBUTTON_H
|
||||
|
||||
#include <components/Interactable.h>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
class InteractableButton final : public Interactable {
|
||||
public:
|
||||
explicit InteractableButton(GameObject& parent);
|
||||
|
||||
std::string GetTypeName() const override { return "InteractableButton"; }
|
||||
|
||||
void Start() override;
|
||||
void Interact(GameObject& interactor) override;
|
||||
|
||||
nlohmann::json Serialize() const override;
|
||||
void Deserialize(const nlohmann::json& data) override;
|
||||
void ImGuiInspector() override;
|
||||
|
||||
[[nodiscard]] std::size_t GetColorIndex() const { return m_ColorIndex; }
|
||||
[[nodiscard]] int GetPressCount() const { return m_PressCount; }
|
||||
|
||||
private:
|
||||
void ApplyColor();
|
||||
|
||||
std::size_t m_ColorIndex{0};
|
||||
int m_PressCount{0};
|
||||
};
|
||||
|
||||
#endif // LIGHTKEEPER_INTERACTABLEBUTTON_H
|
||||
Reference in New Issue
Block a user