Files
Destrum/lightkeeper/include/components/LightToggle.h
T

31 lines
685 B
C++

#ifndef LIGHTKEEPER_LIGHTTOGGLE_H
#define LIGHTKEEPER_LIGHTTOGGLE_H
#include <components/Activatable.h>
class LightToggle final : public Activatable {
public:
explicit LightToggle(GameObject& parent);
std::string GetTypeName() const override { return "LightToggle"; }
void Start() override;
nlohmann::json Serialize() const override;
void Deserialize(const nlohmann::json& data) override;
void ImGuiInspector() override;
void SetOn(bool on);
[[nodiscard]] bool IsOn() const { return m_On; }
protected:
void OnActivate(GameObject& instigator) override;
private:
void Apply();
bool m_On{true};
};
#endif // LIGHTKEEPER_LIGHTTOGGLE_H