feat(tools): 添加UI工具脚本及部署文档
新增内容: 1. 创建 06_工具脚本/UI工具/ 目录,包含4个核心工具脚本 - ExternalCommandListener.cs - 外部命令监听器 - RemoteCommand.cs - 远程命令接口 - UIPrefabGenerator.cs - JSON转预制体生成器 - UIPrefabToJson.cs - 预制体转JSON导出器 2. 更新 UI界面拼接设计指南.md - 新增8.9节工具脚本部署说明 - 包含手动部署和自动部署两种方式 - 添加部署规则和验证步骤 3. 更新 README.md - 添加06_工具脚本章节索引 部署方法: - 手动复制:复制工具脚本到项目 Assets/Editor/Command/ 目录 - 自动部署:使用 DeployUITools.bat 脚本
This commit is contained in:
39
06_工具脚本/UI工具/RemoteCommand.cs
Normal file
39
06_工具脚本/UI工具/RemoteCommand.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
public static class RemoteCommand
|
||||
{
|
||||
public static void ReadJson(string[] args)
|
||||
{
|
||||
SFP.Error("收到参数: " + string.Join(", ", args));
|
||||
}
|
||||
|
||||
public static void GenerateUIPrefab(string[] args)
|
||||
{
|
||||
if (args.Length == 0)
|
||||
{
|
||||
SFP.Error("GenerateUIPrefab: 需要提供JSON文件路径参数");
|
||||
return;
|
||||
}
|
||||
|
||||
string jsonPath = args[0];
|
||||
string prefabPath = args.Length > 1 ? args[1] : null;
|
||||
|
||||
SFP.Error("GenerateUIPrefab: 开始生成UI, JSON路径: " + jsonPath);
|
||||
|
||||
UIPrefabGenerator.GeneratePrefabFromJson(jsonPath, prefabPath);
|
||||
}
|
||||
|
||||
public static void ExportPrefabToJson(string[] args)
|
||||
{
|
||||
if (args.Length == 0)
|
||||
{
|
||||
SFP.Error("ExportPrefabToJson: 需要提供预制体文件路径参数");
|
||||
return;
|
||||
}
|
||||
|
||||
string prefabPath = args[0];
|
||||
string jsonPath = args.Length > 1 ? args[1] : null;
|
||||
|
||||
SFP.Error("ExportPrefabToJson: 开始导出JSON, 预制体路径: " + prefabPath);
|
||||
|
||||
UIPrefabToJson.ExportPrefabToJson(prefabPath, jsonPath);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user