Files
Frostbite2D/Game/include/common/debug/GameDebugActor.h
Lenheart e570fec599 feat(角色): 添加角色阴影渲染功能
新增 CharacterShadowActor 类用于处理角色阴影的渲染
在 CharacterObject 中实现阴影的同步和渲染逻辑
移除 GameDebugActor 中不再使用的合成纹理预览代码
添加 EnsureCompositeTextureReady 方法确保纹理准备就绪
2026-04-07 07:08:53 +08:00

49 lines
1.1 KiB
C++

#pragma once
#include <frostbite2D/2d/actor.h>
namespace frostbite2D {
class CharacterObject;
class GameMap;
class NineSliceActor;
class TextSprite;
/**
* @brief Reusable singleton debug actor for UI scenes.
*/
class GameDebugActor : public Actor {
public:
static GameDebugActor& get();
static Ptr<GameDebugActor> getPtr();
GameDebugActor(const GameDebugActor&) = delete;
GameDebugActor& operator=(const GameDebugActor&) = delete;
bool AttachToScene(Scene* scene);
bool AttachToParent(Actor* parent);
void DetachFromParent();
void SetDebugMap(GameMap* map);
void SetTrackedCharacter(CharacterObject* character);
void ClearDebugContext();
void OnUpdate(float deltaTime) override;
private:
void initOverlay();
void updateOverlay();
void updateMapDebugHighlight();
void setOverlayVisible(bool visible);
GameDebugActor();
~GameDebugActor() override = default;
GameMap* debugMap_ = nullptr;
CharacterObject* trackedCharacter_ = nullptr;
RefPtr<NineSliceActor> background_;
RefPtr<TextSprite> coordText_;
RefPtr<TextSprite> actionText_;
};
} // namespace frostbite2D