Skip to content

Commit

Permalink
2.1.0新插件个格式文档
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed May 17, 2019
1 parent 2827719 commit a9c4609
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion py3env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPT_DIR="$(dirname "$0")";
SCRIPT_DIR="$(cd "$SCRIPT_DIR" && pwd)";

if [ ! -e "$SCRIPT_DIR/py3env/bin/pip3" ]; then
virtualenv -p "$(which python3)" "$SCRIPT_DIR/py3env";
python3 -m virtualenv -p "$(which python3)" "$SCRIPT_DIR/py3env";
export PATH=$SCRIPT_DIR/py3env/bin:$PATH ;
pip install --upgrade pip setuptools ;
pip install --upgrade -r "$SCRIPT_DIR/requirements.txt" ;
Expand Down
40 changes: 22 additions & 18 deletions source/users/advance_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,30 +98,34 @@ Protobuf 插件支持
Protobuf插件 - Message插件
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

+--------------------------------+----------------------------------------------+
| 插件名称 | 插件功能 |
+================================+==============================================+
| org.xresloader.msg_description | 消息体描述信息,会写入输出的header中和代码中 |
+--------------------------------+----------------------------------------------+
| org.xresloader.ue.helper | 生成UE Utility代码的类名后缀 |
+--------------------------------+----------------------------------------------+
+----------------------------------+------------------------------------------------------------------+
| 插件名称 | 插件功能 |
+==================================+==================================================================+
| org.xresloader.msg_description | 消息体描述信息,会写入输出的header中和代码中 |
+----------------------------------+------------------------------------------------------------------+
| org.xresloader.ue.helper | 生成UE Utility代码的类名后缀 |
+----------------------------------+------------------------------------------------------------------+
| org.xresloader.ue.not_data_table | 生成UE Utility代码时,不生产加载代码,这用于带name字段的依赖类型 |
+----------------------------------+------------------------------------------------------------------+

比如 `xresloader sample proto_v3 kind.proto`_ 里, ``arr_in_arr_cfg`` 配置了相关字段,会影响到一些输出。

Protobuf插件 - Field插件
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

+----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| 插件名称 | 插件功能 |
+==================================+====================================================================================================================+
| org.xresloader.field_description | 字段描述信息,会写入输出的header中和代码中 |
+----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| org.xresloader.verifier | 字段描述信息,会写入输出的header中和代码中 |
+----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) |
+----------------------------------+--------------------------------------------------------------------------------------------------------------------+
| org.xresloader.ue.ueTypeName | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 ```TSoftObjectPtr<ueTypeName>``` , 并且支持蓝图中直接引用 |
+----------------------------------+--------------------------------------------------------------------------------------------------------------------+
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| 插件名称 | 插件功能 |
+======================================+======================================================================================================================+
| org.xresloader.field_description | 字段描述信息,会写入输出的header中和代码中 |
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| org.xresloader.verifier | 字段描述信息,会写入输出的header中和代码中 |
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) |
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| org.xresloader.ue.ue_type_name | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 ```TSoftObjectPtr<ue_type_name>``` , 并且支持蓝图中直接引用 |
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| org.xresloader.ue.ue_type_is_class | 生成UE代码时,如果这个字段为true,那么生成的字段类型将是 ```TSoftClassPtr<ue_type_name>``` , 并且支持蓝图中直接引用 |
+--------------------------------------+----------------------------------------------------------------------------------------------------------------------+

比如 `xresloader sample proto_v3 kind.proto`_ 里, ``role_upgrade_cfg`` 内的 ``CostType`` 这一列配置验证器引射到协议的 ``cost_type`` 和 协议描述字段。

Expand Down
8 changes: 7 additions & 1 deletion source/users/output_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
=============================================

.. _xresloader sample: https://github.com/xresloader/xresloader/tree/master/sample
.. _xresloader sample ue csv: https://github.com/xresloader/xresloader/tree/master/sample/proto_v3/csv/Public/Config
.. _xresloader sample ue json: https://github.com/xresloader/xresloader/tree/master/sample/proto_v3/json/Public/Config

所有输出的数据的结构都是按照 https://github.com/xresloader/xresloader/blob/master/header/pb_header_v3.proto 的 ``xresloader_datablocks`` 的结构。 ::

Expand Down Expand Up @@ -117,7 +119,11 @@ Lua和Javacript的输出方式和输出设置有关,也很容易看懂,这

xresloader从2.0.0版本开始支持导出UE所支持的CSV或者JSON格式数据,使用 ``-t ue-csv`` 或 ``-t ue-json`` 可以指定导出的UE支持的数据格式内容。

导出UE数据后,我们还会导出对应加载数据的UE C++类代码,具体可用的控制选项参见 :ref:`data-mapping-available-options` 。我们可以通过以下代码加载:
导出UE数据后,我们还会导出对应加载数据的UE C++类代码,具体可用的控制选项参见 :ref:`data-mapping-available-options` 。

输出的代码有两种模型,一种是扁平模型,会把所有热 **repeated** 字段和 **message** 类型平铺到输出的类里。另一种是保留原始结构的嵌套模式。
目前 ``-t ue-csv`` 使用的是扁平模式, ``-t ue-json`` 使用的是嵌套模式。
`xresloader sample ue csv`_ 和 `xresloader sample ue json`_ 中的是两种模式的输出代码,可以很容易看出来两者的差异和相应插件的功能。

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

Expand Down

0 comments on commit a9c4609

Please sign in to comment.