Skip to content

add LuaImporter and util/Xxtea#876

Merged
chexiongsheng merged 4 commits intoTencent:masterfrom
cn00:master
Apr 26, 2021
Merged

add LuaImporter and util/Xxtea#876
chexiongsheng merged 4 commits intoTencent:masterfrom
cn00:master

Conversation

@cn00
Copy link
Contributor

@cn00 cn00 commented Mar 15, 2021

添加一个基于 ScriptableObject 的 LuaImporter,以便 lua 脚本被包含在 AssetBundle 构建中,无需添加 .txt 后缀;
添加 lua 文件 icon;
可选在导入时自动编译为 luac 字节码(调用 luac,需先构建 build/luac);
可选源码或字节码加密(默认 xxtea 加密),可在 inspector 中预览加解密

@tencent-adm
Copy link
Member

tencent-adm commented Mar 15, 2021

CLA assistant check
All committers have signed the CLA.

@chexiongsheng
Copy link
Collaborator

ScriptedImporter要2018以上版本才有,而且2020和之前版本的名字空间不一样,你这个是2020上的名字空间

@cn00
Copy link
Contributor Author

cn00 commented Mar 19, 2021

2017 是有的。项目原来是 Unity 5 的,原生就可以把 lua 打进 AssetBundle的,升到 2017 发现打不进去了,才加了这个 Importer。整理的时候用了 2020,2018 应该是换了命名空间:
2017是 UnityEditor.Experimental.AssetImporters.ScriptedImporter
2020是 UnityEditor.AssetImporters.ScriptedImporter

@chexiongsheng
Copy link
Collaborator

所以要处理下这差异,否则低版本unity下编译失败

@chexiongsheng
Copy link
Collaborator

API Update 兼容有时候别人不会点
最好像这样处理:https://github.com/Tencent/puerts/blob/master/unity/Assets/Puerts/Src/Editor/CJSImporter.cs

@cn00 cn00 force-pushed the master branch 2 times, most recently from 8e6d16d to 39c0bd9 Compare April 1, 2021 07:19
@chexiongsheng
Copy link
Collaborator

那个lua图标可能是有版权的,不能随便用

@cn00
Copy link
Contributor Author

cn00 commented Apr 25, 2021

那么用 xLua 的 icon 可以吧

@chexiongsheng chexiongsheng merged commit c2cbaf8 into Tencent:master Apr 26, 2021
BlakeLiAFK pushed a commit to BlakeLiAFK/xLua that referenced this pull request Jul 1, 2021
* my_master: (56 commits)
  适配rapidjson/cmsgpack/protobuf
  support valuetype for delegate in XLUA_GENERAL Mode
  fix: (ExampleCongig.typeHasEditorRef) stackoverflow error (Tencent#895)
  2020.2的兼容
  unity2017兼容
  一些告警的解决
  add LuaImporter and util/Xxtea (Tencent#876)
  发布脚本的名字修改
  添加自动发布脚本
  Update faq.md (Tencent#881)
  2020的兼容
  luajit的32位在另外的环境单独编译
  make_android_luajit_arm64.sh的x86输出目录修改
  actions自动编译,window下先启动vc-cmd再编译luajit,更正luajit android x86的路径
  更新注意事项
  处理in关键字生成代码错误的问题,fix Tencent#828
  封装部分api level和luajit编译的api level保持一致
  完善faq
  linux还是不编译32位了
  apt install 要sudo
  ...
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

Successfully merging this pull request may close these issues.

3 participants