lyh916

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  201 随笔 :: 0 文章 :: 12 评论 :: 21万 阅读

xlua官网:https://github.com/Tencent/xLua

 

安装和必看的文档:

 

1.c#调用lua:https://www.jianshu.com/p/8dde7be41d96

2.lua调用c#:https://www.jianshu.com/p/aeb52e214329

3.常用标签

[LuaCallCSharp]:

[CSharpCallLua]:

4.导出

XLuaExporter.cs,放在Editor目录下

复制代码
 1 using System;
 2 using System.Collections.Generic;
 3 using UnityEngine;
 4 using XLua;
 5 
 6 public static class XLuaExporter
 7 {
 8     [LuaCallCSharp]
 9     public static List<Type> luaCallCSharpList = new List<Type>()
10     {
11         typeof(HttpManager),
12     };
13 
14     [CSharpCallLua]
15     public static List<Type> cSharpCallLuaList = new List<Type>()
16     {
17     };
18 
19     [BlackList]
20     public static List<List<string>> blackList = new List<List<string>>
21     {
22     };
23 }
复制代码

点击菜单栏XLua\Generate Code,生成的代码会放在Assets\XLua\Gen下

posted on   艰苦奋斗中  阅读(180)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示