上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 49 下一页
摘要: 像ugui的点击按钮,然后触发相关逻辑,都是回调模式的写法,比如下面代码的ShowAlert调用 public class Test7 : MonoBehaviour { public GameObject m_Alert; public Text m_TxtMsg; public Button m 阅读全文
posted @ 2024-02-29 23:17 yanghui01 阅读(83) 评论(0) 推荐(0)
摘要: c# 部分 public class Test5Obj { public int i; private string str; public Test5Obj() { } public void PrintInt() { Debug.Log($"c# PrintInt:{i}"); } public 阅读全文
posted @ 2024-02-29 23:04 yanghui01 阅读(136) 评论(0) 推荐(0)
摘要: lua实现IEnumerator接口:Assets/Lua/LuaEnumeratorImpl.lua.txt local Move_End_Flag = {} local LuaEnumeratorImpl = {} LuaEnumeratorImpl.__index = LuaEnumerato 阅读全文
posted @ 2024-02-28 22:51 yanghui01 阅读(185) 评论(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 阅读(103) 评论(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 阅读(167) 评论(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 阅读(230) 评论(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 阅读(135) 评论(0) 推荐(0)
摘要: 1, 把头文件放在lua-rapidjson/include下,源码文件放在lua-rapidjson/source下,然后再CMakeList.txt中添加下图所示的内容 2, 加载CMakeList.txt可能会遇到下面的错误 原因是:需要使用vs作为编译器,而不是gnu的编译器 把Visual 阅读全文
posted @ 2024-02-26 23:13 yanghui01 阅读(401) 评论(0) 推荐(0)
摘要: 1, 准备编译好的lua 2, lua加到环境变量Path下 3, 下载openresty维护的cjson源码 GitHub - openresty/lua-cjson: Lua CJSON is a fast JSON encoding/parsing module for Lua 4, 在cjs 阅读全文
posted @ 2024-02-26 22:51 yanghui01 阅读(1232) 评论(0) 推荐(0)
摘要: lua 5.1.5源码 创建一个CMakeList.txt文件 cmake_minimum_required(VERSION 3.10.0) set(Proj_Name "mylua") project(${Proj_Name}) set(CMAKE_C_STANDARD 90) # 使用C98/A 阅读全文
posted @ 2024-02-26 22:18 yanghui01 阅读(365) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 49 下一页