摘要: lua脚本:Assets/Lua/Test3.lua.txt local move_end = {} local LuaEnumeratorImpl = {} LuaEnumeratorImpl.__index = LuaEnumeratorImpl function LuaEnumeratorIm 阅读全文
posted @ 2024-02-28 22:51 yanghui01 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 协程是单线程运行的,它只是提供了一种代码在当前位置暂停,后续还能在当前位置恢复继续执行下去的机制。 1, 启动协程, 以及yield local co1Func = function(str1, str2) for i=1,2 do print(" ", i, str1, str2) local s 阅读全文
posted @ 2024-02-28 22:45 yanghui01 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1, c#对象映射为lua的userdata a) 默认情况,c#对象都是映射为lua的userdata,数据存放在c#层,调用函数也是走c#层。 function LuaUseVector3(v1, v2) v1.x = 10 print(type(v1), v1.x, v1.y, v1.z) p 阅读全文
posted @ 2024-02-28 22:42 yanghui01 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 公共代码 public class Test2 : MonoBehaviour { private LuaEnv m_LuaEnv; void Start() { m_LuaEnv = new LuaEnv(); m_LuaEnv.AddLoader((ref string filePath) => 阅读全文
posted @ 2024-02-28 22:34 yanghui01 阅读(76) 评论(0) 推荐(0) 编辑
摘要: lua代码 Assets/Lua/Test1.lua.txt function IntParam(p) print("~~~~~ IntParam") print(type(p), p) print("~~~~~") return p end function Vec3Param(p) print( 阅读全文
posted @ 2024-02-28 22:17 yanghui01 阅读(28) 评论(0) 推荐(0) 编辑