feat: 添加游戏数学工具类并重构相关代码
refactor: 将数学工具函数移至GameMath类 feat(音频): 实现地图音频控制器 feat(调试): 添加游戏调试UI组件 feat(地图): 增加移动区域边界获取方法 fix(角色): 修复角色移动区域抑制逻辑 refactor(世界): 重构游戏世界场景初始化 docs(音频): 完善音频数据库注释
This commit is contained in:
47
Game/include/common/debug/GameDebugActor.h
Normal file
47
Game/include/common/debug/GameDebugActor.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#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 setOverlayVisible(bool visible);
|
||||
|
||||
GameDebugActor();
|
||||
~GameDebugActor() override = default;
|
||||
|
||||
GameMap* debugMap_ = nullptr;
|
||||
CharacterObject* trackedCharacter_ = nullptr;
|
||||
RefPtr<NineSliceActor> background_;
|
||||
RefPtr<TextSprite> coordText_;
|
||||
};
|
||||
|
||||
} // namespace frostbite2D
|
||||
Reference in New Issue
Block a user