Skip to content

Commit

Permalink
补充UE支持的文档
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Apr 9, 2019
1 parent 9d36e1d commit bdad24e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
5 changes: 4 additions & 1 deletion py3env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ if [ ! -e "$SCRIPT_DIR/py3env/bin/pip3" ]; then
fi

echo "#!/bin/bash
export PATH=$SCRIPT_DIR/py3env/bin:\$PATH ;
export PATH=\"$SCRIPT_DIR/py3env/bin:\$PATH\" ;
\"\$@\"
" > $SCRIPT_DIR/py3env/source.sh ;

4 changes: 2 additions & 2 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ xresloader文档
.. _user-docs:

.. toctree::
:maxdepth: 2
:maxdepth: 3
:caption: 用户文档

users/download
Expand All @@ -67,7 +67,7 @@ xresloader文档
.. _development-docs:

.. toctree::
:maxdepth: 2
:maxdepth: 3
:caption: 开发文档

development/dependency
Expand Down
4 changes: 2 additions & 2 deletions source/users/data_mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
| MacroSource | 元数据数据源 | 文件路径 | 表名 | 数据起始行号,列号 | + **可选** |
| | | | | (英文逗号分隔) | |
+--------------------+------------------------+--------------------+--------------------+----------------------+------------------------------------+
| 编程接口配置 |
| 编程接口配置 |
+--------------------+------------------------+--------------------+--------------------+----------------------+------------------------------------+
| ProtoName | 协议描述名称 | 如: role_cfg | | | + **必须** |
| | | | | | + 协议类型名称 |
Expand All @@ -77,7 +77,7 @@
| OutputFile | 输出文件 | 如: role_cfg.bin | | | + **必须** |
+--------------------+------------------------+--------------------+--------------------+----------------------+------------------------------------+
| KeyRow | 字段名描述行 | 如: 2 | | | + **必须** |
+-------------------+------------------------+--------------------+--------------------+----------------------+------------------------------------+
+--------------------+------------------------+--------------------+--------------------+----------------------+------------------------------------+
| KeyCase | 字段名大小写 | 如: 小写 | | | + 字段名映射时的大小写转换 |
| | | | | | + 可选值: 大写/小写/不变 |
| | | | | | + 如果不需要则留空 |
Expand Down
32 changes: 25 additions & 7 deletions source/users/output_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Json的数据格式是:
.. code-block:: json
[{
"count": 数据条目数量,
"count": "(数字)数据条目数量",
"xres_ver":"xresloader版本号",
"hash_code":"文本输出无hash码",
"data_ver":"数据版本号"
Expand Down Expand Up @@ -74,13 +74,13 @@ Lua和Javacript的输出方式和输出设置有关,也很容易看懂,这
return {
[1] = {
xres_ver = "xresloader版本号",
hash_code = "文本输出无hash码",
data_ver = "数据版本号",
count = 数据条目数量,
xres_ver = "xresloader版本号",
hash_code = "文本输出无hash码",
data_ver = "数据版本号",
count = 0, -- 数据条目数量,
},
协议名 = {
{ Excel数据Key: Excel数据内容 } -- 每行一条,数据内容
PROTO_NAME = {
{ ["Excel数据Key"] = "Excel数据内容" }, -- 每行一条,数据内容
}
}
Expand Down Expand Up @@ -121,6 +121,24 @@ xresloader从2.0.0版本开始支持导出UE所支持的CSV或者JSON格式数

生成完数据后我们在输出目录生成一个 **UnreaImportSettings.json** 文件,用于 **UEEditor-Cmd** 的导入命令。

比如我们UE安装在环境变量 ``$UNREAL_ENGINE_ROOT`` 里,工程UE文件位于 ``$UNREAL_PROJECT_DIR/ShootingGame.uproject`` 。
然后导出目录是 ``$XRESLOADER_OUTPUT_DIR`` 那么我们可以通过

.. code-block:: bash
java -jar -client -t ue-json -o $XRESLOADER_OUTPUT_DIR -f sample-conf/kind.pb \
-m DataSource=role_tables.xlsx|upgrade_10001|3,1 -m ProtoName=role_upgrade_cfg \
-m OutputFile=RoleUpgradeCfg.json -m KeyRow=2 \
-m UeCfg-CodeOutput=$UNREAL_PROJECT_DIR/Source/ShooterGame|Public/Config|Private/Config
来生成配置和代码。如果结构变化,可能需要重新生成工程编译工程的动态库。最后可以再通过UE的命令行工具重新导入资源(以Win64为例),如果之前导入过编辑器里回自动检测到然后提示刷新:

.. code-block:: bash
$UNREAL_ENGINE_ROOT/Engine/Binaries/Win64/UE4Editor-Cmd.exe $UNREAL_PROJECT_DIR/ShootingGame.uproject \
-run=ImportAssets -importsettings=$XRESLOADER_OUTPUT_DIR/UnreaImportSettings.json \
-AllowCommandletRendering -nosourcecontrol
.. _output-format-export enum:

导出枚举类型成代码 (可选)
Expand Down

0 comments on commit bdad24e

Please sign in to comment.