Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改Unity的CS代码模板不生效 #28

Closed
0kk470 opened this issue Oct 19, 2022 · 3 comments
Closed

修改Unity的CS代码模板不生效 #28

0kk470 opened this issue Oct 19, 2022 · 3 comments

Comments

@0kk470
Copy link

0kk470 commented Oct 19, 2022

问题

修改路径Luban.ClientServer\Templates\config\cs_unity_json\下的table.tpl文件后,使用LuaClientServer.exe重新生成的CS代码仍然是旧模板的代码。

尝试

  1. 删除.cache.meta缓存重试,仍然出现相同的问题。

  2. 尝试使用自定义模板搜索路径,无法识别参数。
    image

  3. 尝试使用 --disable_cache 参数失败,因为该参数仅对Server.exe生效。

其他

Bat脚本如下

set WORKSPACE=.

set GEN_CLIENT="%WORKSPACE%/Luban.ClientServer/Luban.ClientServer"
set CONF_ROOT="%WORKSPACE%/DesignerConfigs"

%GEN_CLIENT% -j cfg --^
 -d %CONF_ROOT%/Defines/__root__.xml ^
 --input_data_dir %CONF_ROOT%\Datas ^
 --output_code_dir ../UnityProject/Assets/Script/Data/Excel/Gen ^
 --output_data_dir ../UnityProject/Assets/StreamingAssets/ExcelData/Json ^
 --gen_types code_cs_unity_json,data_json ^
 -s all ^
 --template_search_path ./Luban.ClientServer/Templates/config/cs_unity_json

pause

工具版本为这个commit提交的版本

@pirunxi
Copy link
Contributor

pirunxi commented Oct 19, 2022

如果修改模板未生效,那Luban是根据什么生成最新内容的。 去luban群里讨论一下吧。这个肯定是没有问题的。

单纯从命令行来看,你的 template_search_path有点问题,应该是 --template_search_path ./Luban.ClientServer/Templates 。 另外,如果修改了自带的Templates下的模板,不需要提供 --template_search_path参数,因为默认就会搜索这个。

@pirunxi pirunxi closed this as completed Oct 19, 2022
@0kk470
Copy link
Author

0kk470 commented Oct 19, 2022

如果修改模板未生效,那Luban是根据什么生成最新内容的。 去luban群里讨论一下吧。这个肯定是没有问题的。

单纯从命令行来看,你的 template_search_path有点问题,应该是 --template_search_path ./Luban.ClientServer/Templates 。 另外,如果修改了自带的Templates下的模板,不需要提供 --template_search_path参数,因为默认就会搜索这个。

我就是修改了自带的Templates下的模板不生效才会使用--template_search_path参数

@0kk470
Copy link
Author

0kk470 commented Oct 19, 2022

没事了, 我发现是未使用dynamic类型导致的问题
image
抱歉打扰了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants