Cursor rule
.cursor/rules/unreal-plugin.mdcCursor rules
Quality
50/100
Scores the file, not the repository.Length
256 words
14 headings · 7 code blocksRepository
26
— · pushed 139 days agoLast changed
3 days ago
First indexed 3 days ago.12345# Unreal 插件开发规范67## 插件结构89```10UnrealProjectAnalyzer/ (插件根目录)11├── UnrealProjectAnalyzer.uplugin # 插件描述文件12├── Source/UnrealProjectAnalyzer/13│ ├── Public/ # 头文件14│ ├── Private/ # 实现文件15│ └── UnrealProjectAnalyzer.Build.cs16└── Content/Python/ # Python Bridge 脚本17```1819## 模块职责2021| 文件 | 职责 |22|------|------|23| `UnrealProjectAnalyzer.cpp/h` | 模块入口,HTTP Server 初始化 |24| `BlueprintAnalyzer.cpp/h` | Blueprint 分析逻辑 |25| `AssetAnalyzer.cpp/h` | Asset 引用分析逻辑 |26| `HttpRoutes.cpp/h` | HTTP 路由注册 |2728## HTTP API 设计2930### Blueprint API3132```33GET /blueprint/search?pattern=xxx&class=xxx34GET /blueprint/hierarchy?bp_path=/Game/...35GET /blueprint/dependencies?bp_path=/Game/...36GET /blueprint/referencers?bp_path=/Game/...37GET /blueprint/graph?bp_path=/Game/...&graph_name=EventGraph38GET /blueprint/details?bp_path=/Game/...39```4041### Asset API4243```44GET /asset/search?pattern=xxx&type=xxx45GET /asset/references?asset_path=/Game/...46GET /asset/referencers?asset_path=/Game/...47GET /asset/metadata?asset_path=/Game/...48```4950### Analysis API5152```53GET /analysis/reference-chain?start=xxx&depth=xxx54GET /analysis/cpp-class-usage?class=xxx55```5657## 编码规范5859### 命名6061- 类: `F` 前缀 (struct), `U` 前缀 (UObject), `A` 前缀 (Actor)62- 模块类: `FUnrealProjectAnalyzerModule`63- 布尔值: `b` 前缀 (`bIsEnabled`)6465### 日志6667```cpp68UE_LOG(LogTemp, Log, TEXT("UnrealProjectAnalyzer: Message"));69UE_LOG(LogTemp, Warning, TEXT("UnrealProjectAnalyzer: Warning"));70UE_LOG(LogTemp, Error, TEXT("UnrealProjectAnalyzer: Error"));71```7273### HTTP 路由注册7475```cpp76Router->BindRoute(77 FHttpPath(TEXT("/endpoint")),78 EHttpServerRequestVerbs::VERB_GET,79 [](const FHttpServerRequest& Request, const FHttpResultCallback& OnComplete)80 {81 // 处理请求82 TUniquePtr<FHttpServerResponse> Response = FHttpServerResponse::Create(83 TEXT("{\"key\": \"value\"}"),84 TEXT("application/json")85 );86 OnComplete(MoveTemp(Response));87 return true;88 }89);90```9192## Python Bridge9394Python Bridge 通过 `PythonScriptPlugin` 在模块启动时自动拉起:9596```cpp97// 在 StartupModule() 中98IPythonScriptPlugin* PythonPlugin = FModuleManager::GetModulePtr<IPythonScriptPlugin>("PythonScriptPlugin");99PythonPlugin->ExecPythonCommand(*PythonCommand);100```101102## 依赖模块103104必需的 UE 模块 (在 Build.cs 中声明):105- `HTTP`, `HTTPServer` - HTTP 服务106- `Json`, `JsonUtilities` - JSON 处理107- `UnrealEd`, `BlueprintGraph`, `Kismet` - 蓝图 API108- `AssetRegistry` - 资产引用 API109- `PythonScriptPlugin` - Python 集成110111## 路由参数约定(重要)112113- **含 `/Game/...` 的资产/蓝图路径必须使用 query 参数传递**(例如 `bp_path=/Game/...`、`asset_path=/Game/...`)114- **不要**把 `/Game/...` 直接拼进 URL path(如 `/blueprint/{path}/hierarchy`),因为 UE `HttpServer` 的路由匹配会按 `/` 分段,容易导致无法匹配或编码/解码异常。115
Also in syan2018/UnrealCopilot
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| syan2018/UnrealCopilot.cursor/rules/development-workflow.mdc · 26 | Cursor rules | setuptestlint-formatgit+1 | 78/100 | 3 days ago | |
| syan2018/UnrealCopilot.cursor/rules/mcp-tools-design.mdc · 26 | Cursor rules | api | 62/100 | 3 days ago | |
| syan2018/UnrealCopilot.cursor/rules/project-overview.mdc · 26 | Cursor rules | no sections | 50/100 | 3 days ago | |
| syan2018/UnrealCopilot.cursor/rules/python-guidelines.mdc · 26 | Cursor rules | setuptestlint-format | 73/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/general.mdc · 13 | Cursor rules | teststyledo-notagent-behaviour+1 | 92/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/guard-git.mdc · 119 | Cursor rules | stylearchgitsecurity+2 | 89/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 89/100 | 3 days ago | |
| danielvm-git/bigpowers.cursor/rules/organize-workspace.mdc · 119 | Cursor rules | buildstylegitdeployment+2 | 89/100 | 3 days ago |
