实现NPC系统的核心功能,包括: 1. 新增NpcDataLoader用于加载NPC索引和配置数据 2. 添加NpcAnimation处理NPC动画显示 3. 创建NpcObject实现NPC交互和显示逻辑 4. 在GameMapTestScene中集成测试NPC功能
31 lines
695 B
C++
31 lines
695 B
C++
#pragma once
|
|
|
|
#include "camera/GameCameraController.h"
|
|
#include "character/CharacterObject.h"
|
|
#include "map/GameMap.h"
|
|
#include "npc/NpcObject.h"
|
|
#include "scene/GameDebugUIScene.h"
|
|
#include <frostbite2D/scene/scene.h>
|
|
|
|
namespace frostbite2D {
|
|
|
|
class GameMapTestScene : public Scene {
|
|
public:
|
|
GameMapTestScene();
|
|
~GameMapTestScene() override = default;
|
|
|
|
void onEnter() override;
|
|
void onExit() override;
|
|
void Update(float deltaTime) override;
|
|
|
|
private:
|
|
GameCameraController cameraController_;
|
|
RefPtr<CharacterObject> character_;
|
|
RefPtr<NpcObject> npc_;
|
|
RefPtr<GameDebugUIScene> debugScene_;
|
|
bool initialized_ = false;
|
|
RefPtr<GameMap> map_;
|
|
};
|
|
|
|
} // namespace frostbite2D
|