feat: add basic canvas / improve inspector
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#ifndef LIGHTKEEPER_PLAYERRESPAWN_H
|
||||
#define LIGHTKEEPER_PLAYERRESPAWN_H
|
||||
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
#include <destrum/ObjectModel/Component.h>
|
||||
|
||||
class PlayerRespawn final : public Component {
|
||||
public:
|
||||
explicit PlayerRespawn(GameObject& parent);
|
||||
|
||||
std::string GetTypeName() const override { return "PlayerRespawn"; }
|
||||
|
||||
void Start() override;
|
||||
void FixedUpdate(float fixedDt) override;
|
||||
|
||||
nlohmann::json Serialize() const override;
|
||||
void Deserialize(const nlohmann::json& data) override;
|
||||
void ImGuiInspector() override;
|
||||
|
||||
void SetRespawnPoint(const glm::vec3& worldPosition);
|
||||
[[nodiscard]] const glm::vec3& GetRespawnPoint() const { return m_RespawnPoint; }
|
||||
|
||||
void SetKillHeight(float height) { m_KillHeight = height; }
|
||||
[[nodiscard]] float GetKillHeight() const { return m_KillHeight; }
|
||||
|
||||
void Respawn();
|
||||
|
||||
private:
|
||||
glm::vec3 m_RespawnPoint{0.0f};
|
||||
bool m_HasRespawnPoint{false};
|
||||
float m_KillHeight{-15.0f};
|
||||
};
|
||||
|
||||
#endif // LIGHTKEEPER_PLAYERRESPAWN_H
|
||||
Reference in New Issue
Block a user